/* Market Watch page: CAD reference pricing, movers, and ticker table. */
.market-page { padding-bottom: 54px; }
.market-dashboard { background: var(--white); border-bottom: 1px solid var(--line); }
.market-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr); gap: 34px; align-items: end; padding-top: 42px; padding-bottom: 34px; }
.market-kicker { color: var(--red); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }
.market-head h1 { margin: 8px 0 10px; font-size: clamp(34px, 5vw, 56px); text-transform: uppercase; }
.market-head p { margin: 0; max-width: 620px; color: var(--muted); font-weight: 500; }
.market-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); border-radius: var(--r); overflow: hidden; }
.market-stat { background: var(--cream); padding: 16px; }
.market-stat span { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; font-weight: 800; }
.market-stat b { display: block; margin-top: 4px; font-size: 23px; line-height: 1.1; }

.market-section { padding-top: 34px; }
.market-section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.market-section-head h2 { margin: 0; text-transform: uppercase; font-size: 23px; }
.market-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.market-count { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.market-tabs,
.finish-toggle { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); background: var(--white); border-radius: 9px; }
.market-tabs button,
.finish-toggle button { border: none; background: transparent; color: var(--muted); border-radius: 7px; padding: 8px 12px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: .04em; }
.market-tabs button.active,
.finish-toggle button.active { background: var(--ink-surface); color: #fff; }

.market-pulse { padding-top: 30px; }
.pulse-head { margin-bottom: 14px; }
.pulse-window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(90deg, color-mix(in srgb, var(--red) 5%, var(--white)), var(--white) 18%, var(--white) 82%, color-mix(in srgb, var(--ink) 5%, var(--white)));
  padding: 14px;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.pulse-track { display: flex; width: max-content; animation: pulseScroll 58s linear infinite; will-change: transform; }
.pulse-window:hover .pulse-track { animation-play-state: paused; }
.pulse-set { display: flex; gap: 14px; padding-right: 14px; }
.pulse-card {
  position: relative;
  display: grid;
  grid-template-rows: 122px auto auto auto;
  gap: 7px;
  flex: 0 0 clamp(172px, 15.3vw, 210px);
  min-height: 252px;
  padding: 12px;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(17, 17, 17, .08);
}
.pulse-card:hover { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.pulse-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .07;
  background: linear-gradient(135deg, transparent 0 42%, currentColor 42% 46%, transparent 46% 100%);
  pointer-events: none;
}
.pulse-up { color: #2f8f4e; }
.pulse-down { color: var(--red); }
.pulse-card img {
  align-self: end;
  justify-self: center;
  width: min(88px, 56%);
  aspect-ratio: .716;
  object-fit: contain;
  border-radius: 7px;
  background: var(--tan);
  filter: drop-shadow(0 10px 12px rgba(17, 17, 17, .18));
  transform: rotate(var(--tilt));
  transition: transform .22s var(--ease), filter .22s var(--ease);
}
.pulse-card:hover img {
  filter: drop-shadow(0 14px 16px rgba(17, 17, 17, .22));
  transform: translateY(-4px) rotate(calc(var(--tilt) * -1)) scale(1.04);
}
.pulse-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--white);
  color: currentColor;
  border: 1px solid color-mix(in srgb, currentColor 38%, var(--line));
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pulse-info { min-width: 0; color: var(--ink); }
.pulse-info b,
.pulse-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-info b { font-size: 13px; line-height: 1.2; }
.pulse-info small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: capitalize; }
.pulse-price { color: var(--ink); font-size: 19px; font-weight: 900; line-height: 1; }
.pulse-delta { font-size: 12px; font-weight: 900; }
.pulse-empty { padding: 22px; color: var(--muted); font-size: 13px; font-weight: 700; }
@keyframes pulseScroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.mover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mover-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mover-panel h3 { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line); text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.mover-list { display: grid; }
.mover-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 16px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.mover-row:last-child { border-bottom: none; }
.mover-row:hover { background: color-mix(in srgb, var(--red) 5%, var(--white)); }
.mover-main { min-width: 0; }
.mover-main b,
.mover-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mover-main b { font-size: 13px; }
.mover-main small { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.mover-price { font-weight: 800; white-space: nowrap; }
.mover-empty { padding: 20px 16px; color: var(--muted); font-size: 13px; }

.market-tools { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.market-tools label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.market-tools select,
.market-tools input { min-width: 190px; background: var(--white); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 600; }
.market-tools select { appearance: none; padding-right: 34px; }
.market-search-field { flex: 1 1 260px; max-width: 420px; }
.market-search-field input { width: 100%; min-width: 240px; }

.market-table-shell { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
.market-table { width: 100%; border-collapse: collapse; min-width: 1060px; }
.market-table th,
.market-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.market-table th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; background: color-mix(in srgb, var(--tan) 45%, var(--white)); }
.market-table tbody tr:last-child td { border-bottom: none; }
.market-table tbody tr:hover { background: color-mix(in srgb, var(--red) 4%, var(--white)); }
.market-card-cell { display: flex; align-items: center; gap: 12px; min-width: 280px; }
.market-card-cell img { width: 68px; aspect-ratio: .716; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--tan); flex: 0 0 auto; }
.market-card-cell b,
.market-card-cell small { display: block; }
.market-card-cell b { font-size: 13px; line-height: 1.2; }
.market-card-cell small { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.market-set,
.market-rarity { color: var(--muted); font-size: 12px; font-weight: 600; }
.finish-pill { display: inline-flex; border: 1px solid var(--line); background: var(--tan); color: var(--ink); border-radius: 999px; padding: 3px 8px; text-transform: uppercase; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.finish-pill.label-holofoil { color: #315fb5; border-color: color-mix(in srgb, #315fb5 32%, var(--line)); background: color-mix(in srgb, #315fb5 10%, var(--white)); }
.finish-pill.label-enchanted,
.finish-pill.label-epic,
.finish-pill.label-iconic { color: #7b520c; border-color: color-mix(in srgb, #c08a22 45%, var(--line)); background: color-mix(in srgb, #f0bf45 20%, var(--white)); }
.market-price-cell { white-space: nowrap; }
.market-price-stack { display: grid; gap: 2px; }
.market-price-stack b { color: var(--ink); font-size: 14px; font-weight: 900; line-height: 1.1; }
.market-price-stack small { color: var(--muted); font-size: 10.5px; font-weight: 700; line-height: 1.1; }
.spark { display: block; width: 92px; height: 28px; }
.spark path,
.spark polyline { fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.market-more { display: flex; justify-content: center; padding: 20px 0 0; }
.market-more button[hidden] { display: none; }
.market-empty { text-align: center; color: var(--muted); padding: 24px 0 0; font-weight: 600; }
.market-note { color: var(--muted); font-size: 12px; padding-top: 22px; }
.market-note p { margin: 0; }
.market-note p + p { margin-top: 6px; }

@media (max-width: 980px) {
  .market-head { grid-template-columns: 1fr; }
  .market-stats { max-width: 560px; }
  .mover-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .market-head { padding-top: 30px; }
  .market-stats { grid-template-columns: 1fr 1fr; }
  .market-stat { padding: 13px; }
  .market-stat b { font-size: 19px; }
  .market-section-head { align-items: stretch; flex-direction: column; }
  .market-tabs { width: max-content; }
  .market-tools { align-items: stretch; }
  .market-tools label,
  .market-tools input,
  .market-tools select,
  .finish-toggle { width: 100%; }
  .market-search-field { max-width: none; }
  .market-search-field input { min-width: 0; }
  .finish-toggle button { flex: 1; }
  .pulse-window { padding: 10px; }
  .pulse-set { gap: 10px; padding-right: 10px; }
  .pulse-card { flex-basis: 160px; grid-template-rows: 108px auto auto auto; min-height: 232px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-window { overflow-x: auto; mask-image: none; }
  .pulse-track { animation: none; }
  .pulse-set[aria-hidden="true"] { display: none; }
  .pulse-card img,
  .pulse-card:hover img { transform: rotate(var(--tilt)); transition: none; }
}
