:root {
  color-scheme: dark;
  --bg: #0d1017;
  --panel: #151a24;
  --panel-2: #1b2130;
  --line: #27304260;
  --text: #e7ecf5;
  --muted: #94a0b8;
  --gold: #f0c770;
  --gem: #7cc4ff;
  --accent: #ffb547;
  /* Offer types.  Kept clear of the gem blue and gold so a type pill is
     never mistaken for a price. */
  --card: #7ddca4;
  --card-bg: #173326;
  --style: #c9a6ff;
  --style-bg: #2a2142;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--gem); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Read aloud, never shown. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden;
      clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 64px; }

header.site {
  position: sticky; top: 0; z-index: 10;
  background: #0d1017f2;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex; gap: 12px; align-items: center;
  max-width: 1180px; margin: 0 auto; padding: 11px 16px;
}
.brand { font-weight: 700; letter-spacing: .2px; color: var(--text);
         min-width: 0; overflow: hidden; text-overflow: ellipsis;
         white-space: nowrap; }
.brand span { color: var(--accent); }

nav.links { display: flex; gap: 14px; margin-left: auto; font-size: 14px;
            flex: 0 0 auto; }
nav.links a { color: var(--muted); white-space: nowrap; }
nav.links a[aria-current="page"] { color: var(--accent); }

/* Search on the left, day picker pinned right, on its own row. */
.toolbar {
  display: flex; gap: 12px; align-items: center;
  max-width: 1180px; margin: 0 auto; padding: 0 16px 11px;
}
.search { flex: 1 1 auto; min-width: 0; }
.search input {
  width: 100%; padding: 9px 14px; border-radius: 999px;
  border: 1px solid #2c3648; background: var(--panel-2); color: var(--text);
  font-size: 16px; min-width: 0;
}
.search input::placeholder { color: #707d94; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.picker { flex: 0 0 auto; margin-left: auto; min-width: 0; }
.picker select {
  max-width: 100%; padding: 9px 34px 9px 14px; border-radius: 999px;
  border: 1px solid #2c3648; background: var(--panel-2); color: var(--text);
  font-size: 16px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a0b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.picker select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#results { display: none; margin: 16px 0 0; }
#results.show { display: block; }
#results h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.hit { display: flex; gap: 10px; align-items: center; padding: 9px 12px;
       border-radius: 10px; background: var(--panel); margin-bottom: 6px; }
.hit .nm { font-weight: 600; min-width: 0; }
.hit .meta { margin-left: auto; color: var(--muted); font-size: 13px;
             white-space: nowrap; display: flex; gap: 8px; align-items: center; }

h1 { font-size: clamp(22px, 4vw, 30px); line-height: 1.2; margin: 20px 0 4px; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.sub.split { display: flex; flex-wrap: wrap; gap: 8px 12px;
             align-items: center; justify-content: space-between; }

figure { margin: 0 0 14px; }
/* Full width on a phone; on a big screen capped in height, so the list of
   deals still starts above the fold. */
.shot { display: block; width: auto; height: auto; max-width: 100%;
        max-height: min(58vh, 560px); border-radius: var(--radius);
        border: 1px solid var(--line); background: var(--panel); }

/* -- pills ------------------------------------------------------------- */

.pill { display: inline-flex; align-items: center; flex: none;
        padding: 1px 9px; border-radius: 999px; font-size: 12.5px;
        font-weight: 600; line-height: 1.6; white-space: nowrap;
        background: var(--panel-2); color: var(--muted); }
a.pill:hover { text-decoration: none; filter: brightness(1.18); }
.pill.k-card { background: var(--card-bg); color: var(--card); }
.pill.k-style { background: var(--style-bg); color: var(--style); }
.pill.times, .pill.count { color: var(--text); background: #262e40;
                           font-variant-numeric: tabular-nums; }
.legend { display: inline-flex; gap: 6px; }

/* -- tiles: every list on the site ------------------------------------ */

/* One column on a phone, two on a tablet, three on a desktop. */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
         grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.tiles.list { grid-template-columns: 1fr; }

.tile { background: var(--panel); border-radius: 10px; padding: 9px 12px;
        min-width: 0; }
.tile .line { display: flex; align-items: center; gap: 10px;
              justify-content: space-between; min-width: 0; }
.tile .line + .line, .tile .chips { margin-top: 4px; }
.tile .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
a.nm { color: var(--text); }
.tile .nm a { color: var(--text); }
.tile .nm a:hover, a.nm:hover { color: var(--gem); text-decoration: none; }

.cost { display: flex; flex-wrap: wrap; align-items: center;
        gap: 2px 12px; min-width: 0; font-size: 15px; }
.price { display: inline-flex; align-items: center; gap: 6px; font-weight: 600;
         font-variant-numeric: tabular-nums; }
.price::before { content: ""; flex: none; width: 9px; height: 9px; }
.gems { color: var(--gem); }
.gems::before { background: var(--gem); width: 8px; height: 8px;
                transform: rotate(45deg); border-radius: 2px; }
.gold { color: var(--gold); }
.gold::before { background: var(--gold); border-radius: 50%; }
.was { color: #6f7b91; font-size: 13.5px; margin-left: -6px;
       font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* The printing: set code and collector number, quiet beside the name. */
.set { margin-left: 7px; font-size: 12px; font-weight: 600; color: var(--muted);
       letter-spacing: .3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill .set { margin-left: 5px; color: inherit; opacity: .62; font-size: 11px; }
.ranked .meta .set { margin-left: 2px; }

.ranked { display: flex; gap: 10px; align-items: flex-start; }
.ranked .rank { color: var(--muted); font-variant-numeric: tabular-nums;
                font-size: 14px; min-width: 1.4em; padding-top: 1px; }
.ranked .body { flex: 1 1 auto; min-width: 0; }
.ranked .meta { color: var(--muted); font-size: 13px; }
.ranked .kinds { display: inline-flex; gap: 5px; }

.empty { background: var(--panel); border-radius: var(--radius);
         padding: 28px; color: var(--muted); text-align: center; }

footer.site { color: var(--muted); font-size: 13px; margin-top: 36px;
              border-top: 1px solid var(--line); padding-top: 16px; }

@media (max-width: 720px) {
  .bar { padding: 9px 12px; gap: 8px; }
  .toolbar { padding: 0 12px 9px; gap: 8px; }
  .brand { font-size: 15px; }
  nav.links { gap: 11px; font-size: 13px; }
  .picker select { padding: 8px 30px 8px 11px; }
  .search input { padding: 8px 13px; }
  .wrap { padding: 0 12px 48px; }
  h1 { margin-top: 16px; }
  .shot { border-radius: 8px; }
  figure.wide { overflow-x: auto; border-radius: 8px;
                -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  figure.wide .shot { height: 210px; width: auto; max-width: none;
                      max-height: none; }
}

@media (max-width: 420px) {
  /* Below this the brand and the links cannot share a line honestly. */
  .bar { flex-wrap: wrap; }
  .brand { flex: 1 1 100%; }
  nav.links { margin-left: 0; }
}
