:root {
  --bg: #090a0c;
  --panel: #111318;
  --panel-2: #171920;
  --ink: #f4f1ea;
  --muted: #999a9e;
  --line: rgba(255,255,255,.11);
  --gold: #d8b65b;
  --gold-light: #f3da8d;
  --violet: #8570c8;
  --green: #88bd80;
  --red: #d9786b;
  --blue: #7da8cf;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(6,7,10,.7), rgba(6,7,10,.82)),
    url("assets/mtg-kamigawa-night.png");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.mtg-noise {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.mtg-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 24px 4vw;
}
.mtg-brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; font-weight: 800; letter-spacing: -.04em; }
.mtg-brand > span:last-child { color: var(--gold); }
.mtg-brand > span:last-child > span { color: var(--ink); }
.mtg-brand-mark { display: grid; place-items: center; width: 31px; height: 31px; color: #111 !important; background: var(--gold); border-radius: 50%; font: 500 14px "DM Mono", monospace; }
.mtg-header-label { color: #77797e; font: 10px "DM Mono", monospace; letter-spacing: .16em; text-transform: uppercase; }
.garage-return { justify-self: end; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; font: 11px "DM Mono", monospace; letter-spacing: .07em; text-transform: uppercase; transition: border-color .2s, color .2s; }
.garage-return:hover { color: var(--gold-light); border-color: rgba(216,182,91,.55); }

.mtg-hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 140px 6vw 70px;
  background-image:
    linear-gradient(90deg, rgba(5,6,9,.93) 0%, rgba(5,6,9,.66) 47%, rgba(5,6,9,.34) 78%, rgba(5,6,9,.58) 100%),
    linear-gradient(0deg, rgba(9,10,14,.95) 0%, transparent 38%),
    url("assets/mtg-kamigawa-night.png");
  background-position: center;
  background-size: cover;
}
.mtg-hero::before {
  content: "MAGIC";
  position: absolute;
  right: -2vw;
  bottom: -4vw;
  color: rgba(255,255,255,.022);
  font-size: clamp(150px, 26vw, 440px);
  font-weight: 800;
  letter-spacing: -.09em;
  line-height: .75;
}
.mtg-hero-copy { position: relative; z-index: 2; max-width: 930px; }
.eyebrow { margin: 0 0 20px; color: var(--gold); font: 11px "DM Mono", monospace; letter-spacing: .14em; text-transform: uppercase; }
.mtg-hero h1 { margin: 0; font-size: clamp(70px, 9.2vw, 150px); line-height: .84; letter-spacing: -.035em; text-transform: uppercase; }
.mtg-hero h1 em { color: var(--gold); font-style: normal; }
.hero-lead { max-width: 650px; margin: 38px 0 0; color: #aaa9a6; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.75; }
.hero-orbit { position: absolute; z-index: 1; right: 7vw; top: 19%; width: min(31vw, 460px); aspect-ratio: 1; border: 1px solid rgba(216,182,91,.18); border-radius: 50%; transform: rotate(-12deg); }
.hero-orbit::before, .hero-orbit::after { content: ""; position: absolute; inset: 15%; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; }
.hero-orbit::after { inset: 38%; background: radial-gradient(circle, rgba(216,182,91,.14), transparent 68%); }
.hero-orbit span { position: absolute; display: grid; place-items: center; width: 50px; height: 50px; color: #151515; background: #d9d6cd; border-radius: 50%; box-shadow: 0 7px 28px rgba(0,0,0,.4); font: 500 17px "DM Mono", monospace; }
.hero-orbit span:nth-child(1) { top: -25px; left: calc(50% - 25px); background: #e8e1bf; }
.hero-orbit span:nth-child(2) { top: 30%; right: -25px; color: #102230; background: #8cb9d2; }
.hero-orbit span:nth-child(3) { right: 13%; bottom: -10px; color: white; background: #29262d; }
.hero-orbit span:nth-child(4) { left: 13%; bottom: -10px; color: #37120f; background: #d9806e; }
.hero-orbit span:nth-child(5) { top: 30%; left: -25px; color: #17301a; background: #8fba82; }
.collection-stats { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); max-width: 930px; margin-top: 65px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.collection-stats div { padding: 20px 28px 20px 0; border-right: 1px solid var(--line); }
.collection-stats div:not(:first-child) { padding-left: 28px; }
.collection-stats div:last-child { border-right: 0; }
.collection-stats strong { display: block; margin-bottom: 5px; font-size: clamp(24px, 2.4vw, 40px); letter-spacing: -.05em; }
.collection-stats span { color: #77797e; font: 10px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.scroll-link { position: absolute; left: 6vw; bottom: 28px; display: flex; align-items: center; gap: 12px; color: #6f7074; font: 10px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.scroll-link span { width: 38px; height: 1px; background: var(--gold); }

.section { padding: 110px 6vw; }
.section-heading { display: grid; grid-template-columns: 1fr minmax(280px, 440px); align-items: end; gap: 65px; margin-bottom: 58px; }
.section-heading h2 { margin: 0; font-size: clamp(48px, 6.3vw, 94px); line-height: .91; letter-spacing: -.065em; }
.section-heading > p { margin: 0; color: var(--muted); line-height: 1.8; }

.decks-section { position: relative; overflow: hidden; background: rgba(10,11,15,.88); backdrop-filter: blur(8px); }
.decks-section::after { content: "EDH"; position: absolute; z-index: 0; right: -1vw; top: 35px; color: rgba(216,182,91,.035); font-size: clamp(130px, 22vw, 350px); font-weight: 800; line-height: .8; }
.decks-section > * { position: relative; z-index: 1; }
.deck-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-areas:
    ". bright bright light light ."
    "blight blight shtola shtola killian killian";
  gap: 18px;
}
.deck-card {
  position: relative;
  isolation: isolate;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 24px;
  color: white;
  background-color: #1b1c22;
  background-image:
    linear-gradient(180deg, rgba(4,5,8,.2) 0%, rgba(4,5,8,.08) 38%, rgba(4,5,8,.95) 88%),
    var(--deck-art);
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  box-shadow: 0 22px 55px rgba(0,0,0,.34);
  text-align: left;
  transition: transform .25s, filter .25s, border-color .25s;
}
.deck-card::after { content: ""; position: absolute; z-index: -1; inset: 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 3px; pointer-events: none; }
.deck-card:hover { transform: translateY(-7px); filter: saturate(1.08) brightness(1.05); border-color: rgba(216,182,91,.62); }
.deck-card[aria-expanded="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(216,182,91,.22), 0 22px 55px rgba(0,0,0,.34); }
.deck-index { align-self: flex-start; padding: 7px 9px; color: var(--gold-light); background: rgba(5,6,9,.62); border: 1px solid rgba(255,255,255,.14); border-radius: 99px; font: 10px "DM Mono", monospace; backdrop-filter: blur(8px); }
.deck-card-copy { margin-top: auto; text-shadow: 0 2px 18px rgba(0,0,0,.9); }
.deck-commander { margin: 0 0 8px !important; color: var(--gold-light); font: 500 10px "DM Mono", monospace !important; letter-spacing: .07em; line-height: 1.5; text-transform: uppercase; }
.deck-card h3 { margin: 0 0 10px; font-size: clamp(25px, 2.4vw, 39px); line-height: .93; letter-spacing: -.055em; }
.deck-type { margin: 0 0 20px !important; color: #d1d0cc; font: 10px "DM Mono", monospace !important; letter-spacing: .06em; text-transform: uppercase; }
.deck-card .deck-open { display: flex; justify-content: space-between; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.32); font-size: 12px; font-weight: 800; }
.deck-detail { margin-top: 14px; padding: 38px; border: 1px solid rgba(216,182,91,.28); border-radius: var(--radius); background: #171920; }
.deck-detail-head { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: start; }
.deck-detail h3 { margin: 0; color: var(--gold); font-size: clamp(34px, 4vw, 58px); letter-spacing: -.055em; }
.deck-detail-close { width: 38px; height: 38px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 50%; }
.deck-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 28px 0; background: var(--line); }
.deck-meta div { padding: 18px; background: #171920; }
.deck-meta span { display: block; margin-bottom: 7px; color: #77797e; font: 9px "DM Mono", monospace; letter-spacing: .09em; text-transform: uppercase; }
.deck-meta strong { font-size: 14px; }
.deck-tabs { display: flex; gap: 8px; margin-top: 34px; border-bottom: 1px solid var(--line); }
.deck-tab { position: relative; padding: 13px 18px; color: #85868a; background: transparent; border: 0; font: 10px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.deck-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.deck-tab[aria-selected="true"] { color: var(--gold-light); }
.deck-tab[aria-selected="true"]::after { background: var(--gold); }
.deck-tab-panel { padding-top: 26px; }
.decklist-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 22px; margin-bottom: 22px; padding: 15px 18px; color: #85868a; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 5px; font: 10px "DM Mono", monospace; }
.decklist-summary strong { color: var(--ink); font-size: 15px; }
.decklist-summary span:last-child { margin-left: auto; color: var(--gold-light); }
.decklist-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 13px; }
.decklist-card { position: relative; min-width: 0; padding: 8px 8px 12px; overflow: hidden; color: var(--ink); background: #0c0d11; border: 1px solid var(--line); border-radius: 6px; text-align: left; transition: transform .2s, border-color .2s; }
.decklist-card:hover { transform: translateY(-3px); border-color: rgba(216,182,91,.58); }
.decklist-card img { display: block; width: 100%; aspect-ratio: 488 / 680; margin-bottom: 9px; object-fit: cover; border-radius: 4px; background: #171920; }
.decklist-card strong { display: block; overflow: hidden; color: #e7e5df; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; }
.decklist-card small { display: block; margin-top: 5px; overflow: hidden; color: #6f7075; font: 8px "DM Mono", monospace; text-overflow: ellipsis; white-space: nowrap; }
.deck-card-quantity { position: absolute; z-index: 2; top: 13px; right: 13px; display: grid; place-items: center; min-width: 28px; height: 24px; padding: 0 6px; color: #111; background: var(--gold-light); border-radius: 99px; box-shadow: 0 4px 12px rgba(0,0,0,.45); font: 500 9px "DM Mono", monospace; }
.deck-awaiting { padding: 65px 25px; border: 1px dashed rgba(216,182,91,.3); border-radius: 6px; text-align: center; }
.deck-awaiting strong { display: block; margin-bottom: 9px; color: var(--gold-light); font-size: 22px; }
.deck-awaiting p { max-width: 560px; margin: 0 auto; color: var(--muted); line-height: 1.7; }
.change-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.change-column { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.02); }
.change-column-out { border-top: 2px solid var(--red); }
.change-column-in { border-top: 2px solid var(--green); }
.change-column-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.change-column-heading strong { font: 500 13px "DM Mono", monospace; letter-spacing: .12em; }
.change-column-out .change-column-heading strong { color: #ee8d82; }
.change-column-in .change-column-heading strong { color: #9bd094; }
.change-column-heading span { color: #77797e; font: 9px "DM Mono", monospace; text-transform: uppercase; }
.change-card-list { display: grid; gap: 9px; }
.change-card { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; min-width: 0; padding: 7px; color: var(--ink); background: #0d0e12; border: 1px solid rgba(255,255,255,.08); border-radius: 5px; text-align: left; }
.change-card:hover { border-color: rgba(216,182,91,.45); }
.change-card img { grid-row: 1 / 3; width: 58px; aspect-ratio: 488 / 680; object-fit: cover; border-radius: 3px; }
.change-card strong { align-self: end; overflow: hidden; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; }
.change-card small { align-self: start; margin-top: 4px; color: #707176; font: 8px "DM Mono", monospace; }
.change-card .deck-card-quantity { top: 10px; left: 43px; right: auto; min-width: 24px; height: 20px; }
.change-list { border-top: 1px solid var(--line); }
.change-row { display: grid; grid-template-columns: 92px 1fr 90px; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.change-action { color: var(--gold); font: 10px "DM Mono", monospace; text-transform: uppercase; }
.change-set { color: #77797e; text-align: right; font: 10px "DM Mono", monospace; }
.no-changes { margin: 25px 0 0; color: var(--muted); }

.collection-section { background: rgba(7,8,11,.93); backdrop-filter: blur(10px); }
.collection-heading { margin-bottom: 45px; }
.filter-panel { position: sticky; z-index: 20; top: 10px; display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(20,22,28,.95); box-shadow: 0 18px 55px rgba(0,0,0,.32); backdrop-filter: blur(18px); }
.filter-panel label { position: relative; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.filter-panel label > span { color: #85868a; font: 9px "DM Mono", monospace; letter-spacing: .09em; text-transform: uppercase; }
.filter-panel input, .filter-panel select { width: 100%; height: 44px; padding: 0 13px; color: var(--ink); background: #0d0e12; border: 1px solid var(--line); border-radius: 4px; outline: none; }
.filter-panel input:focus, .filter-panel select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,182,91,.09); }
.filter-panel option { color: var(--ink); background: #16181d; }
.search-field { grid-column: span 2; }
.search-field input { padding-right: 44px; }
.search-field kbd { position: absolute; right: 12px; bottom: 10px; display: grid; place-items: center; width: 24px; height: 24px; color: #77797e; border: 1px solid var(--line); border-radius: 4px; font: 10px "DM Mono", monospace; }
.reset-button { align-self: end; height: 44px; color: var(--gold-light); background: rgba(216,182,91,.08); border: 1px solid rgba(216,182,91,.3); border-radius: 4px; font: 10px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 30px 0 14px; }
.result-bar p { margin: 0; color: #85868a; font: 11px "DM Mono", monospace; }
.result-bar strong { color: var(--ink); font-size: 15px; }
.result-bar #copy-count { margin-left: 7px; color: var(--gold); }
.snapshot { text-transform: uppercase; letter-spacing: .06em; }
.snapshot[data-state="live"] { color: #9fcf9a; }
.snapshot[data-state="cached"] { color: var(--gold); }
.snapshot[data-state="imported"] { color: #d18d85; }
.card-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #101116; }
.card-table { width: 100%; border-collapse: collapse; }
.card-table th { padding: 14px 16px; color: #797a7f; background: #15171c; border-bottom: 1px solid var(--line); font: 9px "DM Mono", monospace; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
.card-table td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.065); color: #a9aaad; font-size: 12px; }
.card-table tbody tr:last-child td { border-bottom: 0; }
.card-table tbody tr:hover td { background: rgba(216,182,91,.035); }
.card-name-cell { min-width: 350px; }
.card-cell-inner { display: flex; align-items: center; gap: 13px; }
.card-thumb-button { flex: 0 0 auto; width: 78px; height: 109px; padding: 0; overflow: hidden; background: linear-gradient(135deg, #20232b, #0b0c10); border: 1px solid rgba(255,255,255,.14); border-radius: 5px; box-shadow: 0 8px 20px rgba(0,0,0,.36); }
.card-thumb-button:hover { border-color: var(--gold); transform: translateY(-1px); }
.card-thumb-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-thumb-button.no-image { cursor: default; }
.card-thumb-button.no-image::after { content: "?"; color: #5f6167; font: 18px "DM Mono", monospace; }
.card-text { min-width: 0; }
.card-table .card-name { color: var(--ink); font-size: 13px; font-weight: 700; }
.card-table .card-sub { display: block; margin-top: 4px; color: #67686d; font: 9px "DM Mono", monospace; }
.card-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.rarity { display: inline-block; min-width: 72px; padding: 5px 7px; border: 1px solid currentColor; border-radius: 99px; font: 8px "DM Mono", monospace; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.rarity-common { color: #97999e; }
.rarity-uncommon { color: #bfc7ce; }
.rarity-rare { color: var(--gold); }
.rarity-mythic { color: #e68059; }
.foil-mark { color: #caa8ff; }
.location-deck { color: var(--gold-light); }
.location-unavailable { color: var(--red); }
.card-status { white-space: nowrap; font: 10px "DM Mono", monospace; }
.status-used { color: var(--gold-light); }
.status-available { color: #9fcf9a; }
.empty-state { padding: 90px 20px; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 8px; font-size: 24px; }
.empty-state span { color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 26px; }
.pagination button { min-width: 38px; height: 38px; padding: 0 12px; color: var(--ink); background: #121419; border: 1px solid var(--line); border-radius: 4px; font: 10px "DM Mono", monospace; }
.pagination button:hover, .pagination button[aria-current="page"] { color: #111; background: var(--gold); border-color: var(--gold); }
.pagination button:disabled { opacity: .35; cursor: default; }
.pagination span { color: #6f7074; }

.card-preview { width: min(820px, calc(100% - 28px)); max-height: calc(100svh - 28px); padding: 0; overflow: hidden; color: var(--ink); background: #111319; border: 1px solid rgba(216,182,91,.34); border-radius: 10px; box-shadow: 0 35px 100px rgba(0,0,0,.7); }
.card-preview::backdrop { background: rgba(2,3,5,.86); backdrop-filter: blur(10px); }
.card-preview[open] { display: grid; grid-template-columns: minmax(260px, 410px) 1fr; }
.preview-image-stage { position: relative; display: grid; place-items: center; min-width: 0; background: #08090c; touch-action: pan-y; }
.card-preview img { width: 100%; height: min(76svh, 570px); object-fit: contain; padding: 22px; user-select: none; -webkit-user-drag: none; }
.preview-copy { align-self: center; padding: 40px 35px 40px 15px; }
.preview-copy h2 { margin: 0 0 18px; font-size: clamp(35px, 5vw, 62px); line-height: .92; letter-spacing: -.055em; }
.preview-copy > p:last-child { color: var(--muted); line-height: 1.7; }
.preview-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 40px; height: 40px; color: white; background: rgba(4,5,8,.68); border: 1px solid rgba(255,255,255,.25); border-radius: 50%; font-size: 25px; line-height: 1; }
.preview-nav { position: absolute; z-index: 2; top: 50%; width: 44px; height: 44px; color: white; background: rgba(4,5,8,.72); border: 1px solid rgba(255,255,255,.3); border-radius: 50%; font-size: 21px; line-height: 1; transform: translateY(-50%); transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.preview-nav:hover, .preview-nav:focus-visible, .preview-close:hover, .preview-close:focus-visible { background: rgba(216,182,91,.2); border-color: var(--gold); outline: none; }
.preview-nav:active { transform: translateY(-50%) scale(.94); }
.preview-previous { left: 10px; }
.preview-next { right: 10px; }
.preview-counter { position: absolute; z-index: 2; left: 50%; bottom: 12px; padding: 6px 10px; color: #e7e3d8; background: rgba(4,5,8,.72); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; font: 9px "DM Mono", monospace; letter-spacing: .1em; transform: translateX(-50%); }

footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; padding: 35px 4vw; background: #07080a; border-top: 1px solid var(--line); font-size: 11px; }
footer p { color: #68696d; text-align: center; }
footer > a:last-child { justify-self: end; }

@media (max-width: 1120px) {
  .deck-card { min-height: 390px; }
  .filter-panel { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column: span 2; }
  .card-table th:nth-child(8), .card-table td:nth-child(8) { display: none; }
}

@media (max-width: 800px) {
  .mtg-header { grid-template-columns: 1fr auto; padding-inline: 22px; }
  .mtg-header-label { display: none; }
  .mtg-hero { min-height: 860px; padding-inline: 22px; }
  .hero-orbit { top: 24%; right: -100px; width: 350px; opacity: .48; }
  .collection-stats { grid-template-columns: repeat(2, 1fr); }
  .collection-stats div:nth-child(2) { border-right: 0; }
  .collection-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .section { padding: 80px 22px; }
  .section-heading { grid-template-columns: 1fr; gap: 28px; }
  .deck-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "bright light"
      "blight shtola"
      "killian killian";
  }
  .filter-panel { position: relative; top: auto; grid-template-columns: repeat(2, 1fr); }
  .card-table th:nth-child(3), .card-table td:nth-child(3), .card-table th:nth-child(7), .card-table td:nth-child(7), .card-table th:nth-child(8), .card-table td:nth-child(8) { display: none; }
  .deck-meta { grid-template-columns: 1fr; }
  .change-comparison { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .mtg-brand > span:last-child { display: none; }
  .mtg-hero { min-height: 820px; padding-top: 120px; }
  .mtg-hero h1 { font-size: clamp(60px, 19vw, 92px); }
  .hero-lead { max-width: 90%; }
  .collection-stats { margin-top: 48px; }
  .collection-stats div, .collection-stats div:not(:first-child) { padding: 16px 12px; }
  .collection-stats span { font-size: 8px; }
  .deck-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "bright"
      "light"
      "blight"
      "shtola"
      "killian";
  }
  .filter-panel { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .deck-card { min-height: 360px; }
  .deck-detail { padding: 25px 18px; }
  .change-row { grid-template-columns: 78px 1fr; }
  .change-set { display: none; }
  .result-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .card-table th, .card-table td { padding: 12px 10px; }
  .card-table th:nth-child(4), .card-table td:nth-child(4) { display: none; }
  .pagination { flex-wrap: wrap; }
  footer { grid-template-columns: 1fr auto; }
  footer p { display: none; }
  .card-name-cell { min-width: 270px; }
  .card-thumb-button { width: 60px; height: 84px; }
  .decklist-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decklist-summary { align-items: flex-start; flex-direction: column; }
  .decklist-summary span:last-child { margin-left: 0; }
  .card-preview[open] { display: block; overflow-y: auto; }
  .card-preview img { height: auto; max-height: 66svh; }
  .preview-nav { width: 42px; height: 42px; }
  .preview-copy { padding: 26px 22px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
