/*
 * Seeing Stone. The colors nod to the Mallard Order's Sanctum (a black ground, bone-colored text,
 * thin gold lines) with Robinhood Chain's neon green marking whatever is live or belongs to the
 * wallet on show (the stone, the active view, a held Initiate, focus).
 *
 * The type is deliberately NOT the Sanctum's, so nobody takes this for the Order's own site: the
 * Sanctum is carved capitals and an old-style serif (Cinzel, EB Garamond, Aldrich). Here it is a
 * modern grotesque in sentence case, closer to the chain's look than to the Order's:
 * Bricolage Grotesque for names and controls, Instrument Sans for reading, DM Mono for numbers.
 * No wide-spaced capitals and no slanted text, which were the Sanctum's other tells.
 */
:root {
  --ground: #050505;
  --ink: #0b0b0d;
  --ink-2: #131316;
  --bone: #e8dfc9;
  --dim: #a79a80;
  --gold: #c9a03f;
  --gold-hi: #e4c36a;
  --hair: rgba(201, 160, 63, 0.32);
  --hair-dim: rgba(201, 160, 63, 0.14);
  --neon: #ccff00;
  --neon-soft: #f2ffb8;
  --neon-deep: #1b2600;
  --ember: #ff8a2a;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --read: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --numf: "DM Mono", Consolas, ui-monospace, monospace;
  --gutter: 16px;
  --tabbar: 0px;
  color-scheme: dark;
}
@media (min-width: 900px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body {
  margin: 0; background: var(--ground); color: var(--bone);
  font: 400 16px/1.55 var(--read); text-rendering: optimizeLegibility;
  background-image: radial-gradient(ellipse 900px 380px at 50% -120px, rgba(204, 255, 0, 0.07), transparent 70%);
  background-repeat: no-repeat;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
}
body.sheet-open { overflow: hidden; }
.page { max-width: 1360px; margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 40px max(var(--gutter), env(safe-area-inset-left, 0px)); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; margin: 0; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; color: var(--gold-hi); }
h4 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--neon); text-decoration-color: rgba(204, 255, 0, 0.4); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--neon); }
b { font-weight: 500; color: #fff8e6; }
small { font-size: 0.75em; }
.dim { color: var(--dim); }
.warn { color: var(--ember); }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--ink); padding: 8px 14px; border: 1px solid var(--neon); }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
dl, dd, dt, ol, ul { margin: 0; padding: 0; }
main:focus { outline: none; }

/* ---- the frame every panel shares: a gold hairline, a second line inside it, a dark face */
.slab {
  position: relative; background: linear-gradient(180deg, var(--ink-2), var(--ink) 120px);
  border: 1px solid var(--hair); box-shadow: inset 0 0 0 3px var(--ground), inset 0 0 0 4px var(--hair-dim), 0 14px 34px rgba(0, 0, 0, 0.6);
  padding: 20px;
}

/* ---- buttons: stone keys. A lit one is the main thing to press. */
.key {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; cursor: pointer;
  font: 600 0.95rem/1 var(--display); text-decoration: none; white-space: nowrap;
  color: var(--bone); background: linear-gradient(180deg, #1c1c1f, #0d0d0f); border: 1px solid var(--hair);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -2px 0 rgba(0, 0, 0, 0.6);
}
.key:hover { border-color: var(--gold); color: #fff; }
.key:active { transform: translateY(1px); }
.key.lit { color: var(--neon-soft); border-color: rgba(204, 255, 0, 0.55); background: linear-gradient(180deg, #243300, var(--neon-deep)); text-shadow: 0 0 10px rgba(204, 255, 0, 0.7); }
.key.lit:hover { border-color: var(--neon); box-shadow: 0 0 18px rgba(204, 255, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--neon); text-decoration: underline; text-decoration-color: rgba(204, 255, 0, 0.4); text-underline-offset: 3px; font: inherit; }
.link:hover { text-decoration-color: var(--neon); }
input[type="text"], input[type="search"], select {
  min-height: 44px; padding: 8px 12px; background: #000; border: 1px solid var(--hair); color: var(--bone); border-radius: 0;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9);
}
input::placeholder { color: #7d7362; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--neon); box-shadow: 0 0 0 1px var(--neon), 0 0 16px rgba(204, 255, 0, 0.18); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--neon); width: 18px; height: 18px; margin: 0; flex: none; }
.sel { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); }
.sel select { }

/* ---- whose site this is, said before anything else */
.community { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--hair-dim); color: var(--dim); font-size: 0.88rem; line-height: 1.4; }
.guess { cursor: help; }
.foot b { color: var(--bone); }

/* ---- header: the stone, the name, the question */
.top { display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center; padding: 22px 0 18px; }
.stone {
  --glow: 0.35; position: relative; width: 58px; height: 58px; border-radius: 50%; padding: 0; cursor: pointer; flex: none;
  border: 1px solid var(--gold); background: radial-gradient(circle at 34% 28%, #dfe6c8 0%, #6f7a52 16%, #242b12 52%, #060703 100%);
  box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--hair), 0 0 26px rgba(204, 255, 0, calc(var(--glow) * 0.4));
}
.stone.lit, .stone.big { --glow: 1; background: radial-gradient(circle at 34% 28%, #fbffe6 0%, var(--neon) 16%, #577000 50%, #0a0f00 100%); }
.stone-eye { position: absolute; inset: 7px; border-radius: 50%; background: radial-gradient(circle at 60% 66%, rgba(0, 0, 0, 0.55), transparent 55%); mix-blend-mode: multiply; }
.stone:hover { --glow: 1.6; }
.stone.scrying { animation: scry 0.6s ease-out; }
@keyframes scry { 0% { box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--neon), 0 0 0 0 rgba(204, 255, 0, 0.9); filter: brightness(1.8); } 100% { box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--hair), 0 0 0 46px rgba(204, 255, 0, 0); filter: none; } }
.brand { text-decoration: none; color: var(--bone); display: grid; gap: 2px; min-width: 0; }
.brand-name { font: 800 clamp(1.6rem, 5.4vw, 2.3rem)/1 var(--display); letter-spacing: -0.035em; }
.brand-sub { color: var(--dim); font-size: 0.92rem; }
.ask { grid-column: 1 / -1; display: grid; gap: 6px; }
.ask > label { color: var(--dim); }
.ask-row, .versus { display: flex; gap: 8px; }
.ask-row input, .versus input { flex: 1; min-width: 0; }
.ask-note { color: var(--ember); min-height: 0; font-size: 0.95rem; }
.ask-note:empty { display: none; }
@media (min-width: 900px) {
  .top { grid-template-columns: auto auto 1fr; padding: 30px 0 22px; gap: 20px; }
  .stone { width: 68px; height: 68px; }
  .ask { grid-column: auto; justify-self: end; width: min(100%, 520px); }
}

/* ---- the wallet on show */
.bearer { border: 1px solid var(--hair); border-left: 3px solid var(--neon); background: linear-gradient(90deg, rgba(204, 255, 0, 0.06), transparent 45%), var(--ink); padding: 14px 16px; margin-bottom: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.bearer-one { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; min-width: 0; }
.bearer-id { min-width: 0; }
.bearer-id h1, .bearer-id h2 { font-size: clamp(1.15rem, 4vw, 1.6rem); color: #fff8e6; overflow-wrap: anywhere; text-transform: none; }
.addr { font-size: 0.95rem; }
.avatar { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--gold); object-fit: cover; flex: none; background: #000; }
.avatar.blank { background: radial-gradient(circle at 35% 30%, #3b4420, #0a0c05 70%); }
.stats { display: flex; gap: 22px; }
.stats dt, .tile dt { color: var(--dim); font-size: 0.95rem; }
.stats dd { font: 500 1.3rem/1.1 var(--numf); color: #fff8e6; }
.pips { display: flex; flex-wrap: wrap; gap: 6px 12px; font: 400 0.9rem/1 var(--numf); }
.pipc { display: inline-flex; align-items: center; gap: 5px; }
/* A School's sigil, the Sanctum's round mark (web/schools/), sized by the text it stands in. A swatch is a plain
   square of a School's color: the key to a chart drawn in those colors, and the mark of a School without a sigil. */
.sigil { width: 1.3em; height: 1.3em; border-radius: 50%; flex: none; display: inline-block; vertical-align: -0.3em; }
.swatch { width: 10px; height: 10px; background: var(--c); display: inline-block; flex: none; }
.bearer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.versus { flex: 1 1 220px; min-width: 0; max-width: min(460px, 100%); }
.bearer-pair { display: grid; gap: 12px; align-items: center; }
.vs { font: 700 1rem var(--display); color: var(--gold); }
@media (min-width: 900px) { .bearer-pair { grid-template-columns: 1fr auto 1fr; } }

/* ---- the views' tabs: a row under the header; on a phone a bar at the bottom of the screen */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--hair); margin-bottom: 22px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 12px 16px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font: 600 0.98rem/1 var(--display); color: var(--dim); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--bone); }
.tab.on { color: var(--neon); border-bottom-color: var(--neon); text-shadow: 0 0 12px rgba(204, 255, 0, 0.55); }
.tab.needs { opacity: 0.6; }
/* The Pageant's name in the tab bar: hot pink and glowing, the one thing here that is not gold or green. Open, its line is pink too. */
.glam { color: #ff4fb6; text-shadow: 0 0 8px rgba(255, 79, 182, 0.85), 0 0 20px rgba(255, 45, 160, 0.5); }
.tab:hover .glam { color: #ff8ad0; }
.tab.on .glam { color: #ff7cc8; text-shadow: 0 0 6px rgba(255, 255, 255, 0.35), 0 0 12px rgba(255, 79, 182, 0.95), 0 0 28px rgba(255, 45, 160, 0.7); }
.tab.on:has(.glam) { border-bottom-color: #ff4fb6; }
@media (max-width: 719px) {
  :root { --tabbar: 54px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; background: rgba(5, 5, 5, 0.96); border-bottom: 0; border-top: 1px solid var(--hair); padding: 0 6px env(safe-area-inset-bottom, 0px); backdrop-filter: blur(6px); }
  .tab { min-height: 54px; padding: 0 13px; border-bottom: 0; border-top: 2px solid transparent; margin: -1px 0 0; font-size: 0.88rem; }
  .tab.on { border-top-color: var(--neon); }
  .tab.on:has(.glam) { border-top-color: #ff4fb6; }
}

/* ---- shared view parts */
.view-head { display: grid; gap: 8px; margin-bottom: 20px; max-width: 76ch; }
.view-head h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); letter-spacing: -0.03em; }
.lede { font-size: 1.12rem; line-height: 1.45; }
.yours-line { color: var(--neon-soft); }
.yours-line b { color: var(--neon); }
.block { margin-bottom: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.block > h3 { margin-bottom: 2px; }
.block-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.sub-head { margin: 26px 0 12px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
/* the trade link (Set builder) and the box an invitation asks the visitor's wallet in */
.invite-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.invite-link { flex: 1 1 280px; min-width: 0; max-width: 560px; font-family: var(--numf); font-size: 0.9rem; color: var(--neon-soft); }
.invite-said:empty { display: none; }
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 620px; }
.invite-form .ask-row { flex-wrap: wrap; }
.invite-form .ask-row input { flex: 1 1 220px; }
.invite-form label { font: 600 1.05rem var(--display); color: var(--gold-hi); }
.empty { padding: 44px 16px; text-align: center; border: 1px dashed var(--hair); display: grid; gap: 8px; justify-items: center; grid-column: 1 / -1; }
.empty b { font: 700 1.15rem var(--display); color: var(--bone); }
.empty p { color: var(--dim); max-width: 56ch; }
/* inline, not a flex box: the name keeps the baseline of the line the mark stands in */
.school { white-space: nowrap; }
.school > .sigil, .school > .swatch { margin-right: 7px; }
.school > .sigil + .swatch { margin-left: -2px; }
.meter { display: block; height: 8px; background: rgba(255, 255, 255, 0.06); min-width: 40px; }
.meter i { display: block; height: 100%; }
.seg { display: inline-flex; border: 1px solid var(--hair); }
.seg button { background: #0c0c0e; border: 0; border-right: 1px solid var(--hair); min-height: 40px; padding: 6px 14px; cursor: pointer; color: var(--dim); font: 600 0.88rem var(--display); }
.seg button:last-child { border-right: 0; }
.seg button.on { color: var(--neon); background: var(--neon-deep); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.95rem; }
.legend b { font: 400 0.85rem var(--numf); }
#deal-legend .swatch { border-radius: 50%; }
.legend .own .swatch { background: transparent; border: 2px solid var(--neon); }
.tag { display: inline-block; font: 400 0.68rem/1 var(--numf); padding: 3px 5px 2px; border: 1px solid var(--hair); color: var(--dim); margin-left: 5px; white-space: nowrap; vertical-align: 1px; }
.tag.one { color: var(--gold-hi); border-color: var(--gold); }
.tag.mult { color: var(--neon-soft); border-color: rgba(204, 255, 0, 0.45); }
.tag.awake { color: #b6e07a; border-color: rgba(182, 224, 122, 0.4); }
.tag.cool { color: var(--ember); border-color: rgba(255, 138, 42, 0.45); }
.tag.yours { color: #0a0f00; background: var(--neon); border-color: var(--neon); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 10px 7px 0; vertical-align: middle; font-weight: 400; }
td.n, th.n { text-align: right; font-family: var(--numf); font-size: 0.9rem; white-space: nowrap; }
thead th { color: var(--dim); border-bottom: 1px solid var(--hair); font-size: 0.95rem; font-family: var(--read); }
thead th.n { font-family: var(--read); font-size: 0.95rem; white-space: normal; }
tbody tr + tr > * { border-top: 1px solid var(--hair-dim); }
caption { text-align: left; color: var(--dim); padding-bottom: 4px; }
.rows .wide { width: 45%; }
.rows .spare { white-space: nowrap; }
.scroll { overflow-x: auto; }

/* ---- Explore */
.bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.bar #ex-q { width: 150px; }
.summary { color: var(--dim); margin-left: auto; }
.ex-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.ex-side { border: 1px solid var(--hair); background: var(--ink); padding: 14px; display: grid; gap: 12px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.side-head { display: flex; align-items: center; gap: 12px; }
.side-head h2 { font-size: 1.1rem; color: var(--gold-hi); margin-right: auto; }
.side-close, #ex-toggle { display: none; }
.fgroup { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.fgroup legend { padding: 0; color: var(--dim); margin-bottom: 4px; }
.fgroup label, .fopts label { display: flex; align-items: center; gap: 9px; min-height: 32px; cursor: pointer; }
.fgroup .sel { justify-content: space-between; color: var(--bone); }
.fgroup .sel select { max-width: 62%; min-height: 38px; padding: 4px 8px; }
.scope { border-left: 2px solid var(--neon); padding-left: 10px; }
.tf { border-top: 1px solid var(--hair-dim); }
.tf summary { display: flex; align-items: center; gap: 8px; min-height: 42px; cursor: pointer; list-style: none; }
.tf summary::-webkit-details-marker { display: none; }
.tf summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: rotate(-45deg); transition: transform 0.15s; flex: none; }
.tf[open] summary::before { transform: rotate(45deg); }
.tn { margin-right: auto; }
.tk { color: var(--dim); font: 400 0.8rem var(--numf); padding-right: 8px; }
.tc { background: var(--neon); color: #0a0f00; font: 400 0.75rem/1 var(--numf); padding: 3px 6px 2px; }
.tb { padding: 0 0 10px 15px; display: grid; gap: 6px; }
.fq { min-height: 36px !important; width: 100%; }
.fopts { max-height: 264px; overflow-y: auto; display: grid; padding-right: 8px; }
.fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc { font: 400 0.8rem var(--numf); color: var(--dim); }
.fopts label.zero { opacity: 0.4; }
.hint { color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 8px 2px 10px; background: var(--neon-deep); border: 1px solid rgba(204, 255, 0, 0.4); color: var(--neon-soft); cursor: pointer; font-size: 0.95rem; }
.chip i { color: var(--dim); }
.chip .cx { color: var(--neon); font-size: 1.1rem; line-height: 1; }
.chip:hover { border-color: var(--neon); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.cards.few { grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); }
.card { display: block; text-decoration: none; color: var(--bone); background: var(--ink); border: 1px solid var(--hair-dim); min-width: 0; }
.card:hover { border-color: var(--gold); }
.card.mine { border-color: var(--neon); box-shadow: 0 0 0 1px var(--neon), 0 0 22px rgba(204, 255, 0, 0.16); }
.card.ghost { display: grid; place-items: center; min-height: 120px; border-style: dashed; }
.picwrap { position: relative; aspect-ratio: 1; background: #000; overflow: hidden; }
.pic { width: 100%; height: 100%; object-fit: cover; display: block; }
.nopic { display: grid; place-items: center; color: #6d6455; font-size: 0.9rem; text-align: center; background: repeating-linear-gradient(45deg, #0a0a0b, #0a0a0b 8px, #0e0e10 8px, #0e0e10 16px); }
/* The School's sigil over the picture, as large against it as the Sanctum draws its own (30px on a tile's 204px
   picture) and with the same shadow under it; never larger than the Sanctum's. */
.pip { position: absolute; left: 6px; top: 6px; width: clamp(20px, 14.7%, 30px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9)); }
i.pip { left: 9px; top: 9px; width: 11px; filter: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.75); }
/* A rarity tier's stars, as the Sanctum counts them: three for the Top 100, two for Rare, one for Uncommon. One
   element with the star repeated --n times: in a line of text it is as tall as a capital; over a picture it sits in
   the corner across from the School's sigil, sized against the picture as the sigil is, with the same shadow. */
.stars { display: inline-block; flex: none; width: calc(var(--n) * 1em); height: 1em; vertical-align: -0.14em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.3l2.95 6.2 6.75.9-4.95 4.7 1.25 6.7L12 17.5l-6 3.3 1.25-6.7L2.3 9.4l6.75-.9z' fill='%23f6c945' stroke='%23211500' stroke-width='1.7' stroke-linejoin='round' paint-order='stroke'/%3E%3C/svg%3E") 0 50% / 1em 1em repeat-x; }
.stars.over { position: absolute; right: 5px; top: 8px; width: calc(var(--n) * clamp(13px, 9.6%, 20px)); height: auto; aspect-ratio: var(--n) / 1; background-size: calc(100% / var(--n)) 100%; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9)); }
.info { padding: 9px 10px 10px; display: grid; gap: 4px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px 6px; min-width: 0; }
.row .tid { font: 500 0.92rem var(--numf); margin-right: auto; display: inline-flex; align-items: center; }
.row .tid ~ .tag { margin-left: 0; }
.price { font: 400 0.84rem var(--numf); color: var(--neon); white-space: nowrap; }
.price small { color: var(--dim); }
.row.sub { color: var(--dim); font: 400 0.76rem var(--numf); min-height: 18px; }
.row.note { color: var(--dim); font-size: 0.9rem; justify-content: flex-start; }
.more { display: flex; margin: 22px auto 0; }
.thumb { display: inline-grid; gap: 3px; text-decoration: none; color: var(--bone); font: 400 0.75rem var(--numf); vertical-align: middle; }
.mini { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--hair-dim); display: block; }
.thumb:hover .mini { border-color: var(--neon); }
.mini.nopic { font-size: 0.6rem; }
.strip { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 899px) {
  .ex-layout { grid-template-columns: minmax(0, 1fr); }
  #ex-toggle, .side-close { display: inline-flex; }
  .ex-side { display: none; }
  .ex-side.open { display: grid; position: fixed; inset: auto 0 0 0; z-index: 40; max-height: 82vh; border-width: 1px 0 0; border-top-color: var(--neon); padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -20px 50px #000; }
  .ex-side.open .side-head { position: sticky; top: -14px; background: var(--ink); padding: 8px 0; z-index: 1; }
  .summary { margin-left: 0; width: 100%; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cards.few { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar #ex-q { flex: 1; width: auto; min-width: 110px; }
}
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); z-index: 30; }

/* ---- one Initiate */
dialog.token { width: min(880px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); padding: 20px; color: var(--bone); background: var(--ink); border: 1px solid var(--gold); box-shadow: inset 0 0 0 3px var(--ground), inset 0 0 0 4px var(--hair-dim), 0 30px 80px #000; overflow-y: auto; }
dialog.token::backdrop { background: rgba(0, 0, 0, 0.82); }
.tk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tk-head h2 { }
.x { background: none; border: 1px solid var(--hair); color: var(--bone); width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; cursor: pointer; flex: none; }
.x:hover { border-color: var(--neon); color: var(--neon); }
.tk-body { display: grid; gap: 18px; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); margin-bottom: 18px; }
.tk-pic { position: relative; align-self: start; }
.tk-pic .stars.over { right: 10px; top: 10px; width: calc(var(--n) * 26px); }
.big { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border: 1px solid var(--hair); background: #000; }
.tk-facts { display: grid; gap: 14px; align-content: start; }
.tk-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-tags .tag { margin-left: 0; font-size: 0.75rem; }
.facts { display: grid; gap: 8px; }
.facts > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: baseline; }
.facts dt { color: var(--dim); }
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.traits th[scope="row"] { color: var(--dim); }
.kin { margin-top: 18px; display: grid; gap: 8px; }
.kin-item { display: grid; gap: 2px; font-size: 0.85rem; max-width: 80px; }
.kin-item .mini { width: 72px; height: 72px; }
@media (max-width: 640px) {
  dialog.token { padding: 14px; }
  .tk-body { grid-template-columns: minmax(0, 1fr); }
  .tk-pic { max-width: 300px; }
  .traits th:nth-child(4), .traits td:nth-child(4) { display: none; }
  .traits { font-size: 0.94rem; }
  .traits td, .traits th { overflow-wrap: anywhere; padding-right: 8px; }
  .traits td.n { white-space: normal; }
}

/* ---- Schools */
.schools { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.school-card { display: grid; gap: 12px; align-content: start; border-top: 3px solid var(--c); }
.school-card h3 { font-size: 1.4rem; color: #fff8e6; display: flex; align-items: center; gap: 12px; }
.school-card h3 .sigil { width: 44px; height: 44px; }
.figure b { font: 500 1.45rem var(--numf); letter-spacing: -0.02em; margin-right: 4px; }
.school-card .facts > div { grid-template-columns: 1fr auto; }
.school-card dd { font-family: var(--numf); font-size: 0.9rem; text-align: right; }
.cheapest { display: flex; align-items: center; gap: 12px; color: var(--dim); }
.school-card .links { display: grid; gap: 4px; }

/* ---- the Reading, the Set builder, Compare */
.reading-head { text-align: center; justify-items: center; max-width: none; padding: 10px 0 6px; }
.reading-title { font-size: clamp(2rem, 8vw, 3.8rem) !important; font-weight: 800; letter-spacing: -0.04em; color: #fff8e6; text-shadow: 0 0 28px color-mix(in srgb, var(--c, var(--neon)) 55%, transparent); }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 22px; }
.tile { display: grid; gap: 4px; align-content: start; }
.tile dd { font: 500 1.9rem/1.1 var(--numf); letter-spacing: -0.02em; color: var(--neon); text-shadow: 0 0 16px rgba(204, 255, 0, 0.3); }
.tile p { color: var(--dim); font-size: 0.98rem; }
.need { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--hair-dim); }
.pair-legend { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.pair-who { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; overflow-wrap: anywhere; }
.pair-who i { width: 12px; height: 12px; align-self: center; flex: none; }
.pair-who b { font: 700 1.05rem/1.2 var(--display); color: #fff8e6; }
.pair-who small, .pair-line small { color: var(--dim); font-size: 0.82rem; }
.w0 i { background: var(--neon); }
.w1 i { background: var(--gold); }
.pairs { display: grid; }
.pair { --pair-label: 124px; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--hair-dim); }
.pair-bars { display: grid; gap: 3px; min-width: 0; }
.pair-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pair-line i { display: block; height: 13px; min-width: 2px; flex: none; }
.pair-line b { font: 500 0.92rem/1 var(--numf); }
.pair-line small { white-space: nowrap; }
@media (max-width: 560px) {
  .pair { grid-template-columns: minmax(0, 1fr); --pair-label: 112px; }
}
.tiers { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); align-items: start; margin-bottom: 22px; }
.tier { border-top: 3px solid var(--gold); }
.tier.done { border-top-color: var(--neon); }
.swap { display: grid; gap: 4px; font-size: 1.15rem; color: #fff8e6; }
.swap .dim { font: 400 0.95rem var(--read); }
.gives-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.gives-line .who-name { overflow-wrap: anywhere; }
.gives-line .school { align-self: center; }
.locked-one { display: inline-flex; align-items: center; gap: 2px; }
.locked-one .thumb { grid-auto-flow: column; align-items: center; gap: 6px; }
.locked-one .mini { width: 34px; height: 34px; border-color: var(--neon); }
.locked-one .thumb span { font-size: 0.88rem; color: var(--neon-soft); }
.x.unlock { width: 30px; height: 34px; font-size: 1.1rem; border-color: transparent; color: var(--dim); }
.pick-open { font: 400 0.88rem var(--read); min-height: 32px; }
.lock-picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; background: #000; border: 1px solid var(--hair); }
.lock-cards { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; max-height: 470px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.lock-item { display: grid; gap: 6px; align-content: start; min-width: 0; }
.lock-item .key { min-height: 38px; padding: 6px 8px; font-size: 0.85rem; }
.lock-item .key:disabled { opacity: 0.5; cursor: default; }
.lock-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 16px; }
.run-steps li .lock-picker { grid-column: 1 / -1; }
.run { margin-top: 22px; border-top: 3px solid var(--neon); }
.run-steps { list-style: none; counter-reset: step; display: grid; }
.run-steps li { counter-increment: step; display: grid; grid-template-columns: 26px minmax(0, auto) minmax(0, 1fr); gap: 4px 16px; align-items: center; padding: 9px 0; border-top: 1px solid var(--hair-dim); }
.run-steps li::before { content: counter(step); font: 400 0.85rem var(--numf); color: var(--dim); }
.run-steps .swap { font-size: 1rem; font-family: var(--display); font-weight: 700; gap: 2px; }
@media (max-width: 560px) { .run-steps li { grid-template-columns: 26px minmax(0, 1fr); } .run-steps li > :last-child { grid-column: 2; } }
.does { display: flex; flex-wrap: wrap; gap: 3px 7px; align-items: center; }
.does.full, .does.full b { color: var(--neon); }
.why { display: flex; flex-wrap: wrap; gap: 3px 7px; align-items: center; }
.compare-head h2 { color: var(--ember); overflow-wrap: anywhere; }
.compare-head.can h2 { color: var(--neon); }
.compare-head .lede { display: grid; gap: 4px; }
.want-bar { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-bottom: 20px; }
.want-one { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-width: 0; }
.want-one b { overflow-wrap: anywhere; }
.hint-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hint-row .key { text-align: left; overflow-wrap: anywhere; }
.tier h3 { font-size: 1.3rem; color: #fff8e6; }
.takes { display: grid; gap: 12px; }
.takes > div { display: grid; gap: 4px; }
.takes dt { color: var(--dim); overflow-wrap: anywhere; }
.takes dd { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 1.08rem; }
.take { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.take b { font-family: var(--numf); }

/* ---- the Wall */
.wall-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 250px; align-items: start; }
.wall-wrap { min-width: 0; line-height: 0; }
#wall-canvas { cursor: crosshair; image-rendering: pixelated; max-width: 100%; touch-action: manipulation; }
.wall-side { display: grid; gap: 14px; padding: 14px; position: sticky; top: 12px; }
.loupe { width: 100%; aspect-ratio: 1; background: #000; border: 1px solid var(--hair); cursor: pointer; display: block; }
.picked { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.picked > p { grid-column: 1 / -1; }
.picked-facts { display: grid; gap: 4px; min-width: 0; }
.picked-facts .key { margin-top: 6px; justify-self: start; }
.tagline .tag:first-child { margin-left: 0; }
.picked-pic .mini { width: 72px; height: 72px; }
@media (max-width: 899px) {
  .wall-layout { grid-template-columns: minmax(0, 1fr); }
  .wall-side { position: static; grid-template-columns: 150px 1fr; align-items: start; }
  .picked { grid-template-columns: 1fr; }
  .picked-pic { display: none; }
}

/* ---- Boards */
.boards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.boards.five { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.board { display: grid; gap: 10px; align-content: start; }
.ranks { list-style: none; display: grid; }
.ranks li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 70px auto; gap: 8px; align-items: center; min-height: 34px; border-top: 1px solid var(--hair-dim); }
.ranks li:first-child { border-top: 0; }
.place { font: 400 0.8rem var(--numf); color: var(--dim); }
.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val { font: 400 0.9rem var(--numf); text-align: right; min-width: 34px; }
.ranks li.me { background: linear-gradient(90deg, rgba(204, 255, 0, 0.12), transparent); box-shadow: inset 2px 0 0 var(--neon); padding-left: 6px; }
.who { color: var(--bone); text-decoration-color: var(--hair); white-space: nowrap; }
.who:hover { color: var(--neon); }

/* ---- Deals */
.chart { position: relative; min-height: 260px; }
.chart svg { display: block; max-width: 100%; touch-action: manipulation; }
.chart .grid line { stroke: rgba(232, 223, 201, 0.09); stroke-width: 1; }
.chart .grid text { fill: var(--dim); font: 400 11px var(--numf); }
.chart .grid text.axis { font: 400 12px var(--read); }
.chart .floor { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 5 4; }
.chart .dots circle { stroke: var(--ground); stroke-width: 1.5; }
.chart .dots circle.own { stroke: var(--neon); stroke-width: 2; }
.chart .hot { fill: none; stroke: #fff; stroke-width: 2; pointer-events: none; }
.tier-rows { display: grid; gap: 18px; }
.tier-row h4 { font-size: 1.05rem; color: #fff8e6; }
.tier-row h4 .dim { font: 400 0.95rem var(--read); letter-spacing: 0; margin-left: 4px; }
.tier-row h4 .stars { font-size: 1.15em; margin-right: 2px; }
.tip { position: absolute; z-index: 2; background: #000; border: 1px solid var(--gold); padding: 8px 10px; font-size: 0.95rem; line-height: 1.35; box-shadow: 0 8px 24px #000; white-space: nowrap; }

/* ---- Offers */
.yours-block { border-left: 3px solid var(--neon); }
.withnum { display: grid; grid-template-columns: minmax(40px, 1fr) auto; gap: 10px; align-items: center; font: 400 0.85rem var(--numf); }
.ladder .wide { min-width: 140px; }
.traits th[scope="row"] .thumb { grid-auto-flow: column; align-items: center; gap: 8px; }
.traits th[scope="row"] .mini { width: 40px; height: 40px; }

/* ---- the Pageant: two pictures and nothing else. Their size is fixed by the window, never by what is in them,
   so the next pair and the answer under it move nothing. */
.pg { display: grid; gap: 12px; justify-items: center; scroll-margin-top: 4px; }
/* The question is a pun; the line under it says in plain words what to judge by, so nobody picks by rarity or price. */
.pg-head { display: grid; gap: 2px; justify-items: center; text-align: center; }
.pg-q { font-size: clamp(1.5rem, 5vw, 2.1rem); letter-spacing: -0.03em; }
.pg-how { color: var(--bone); font-size: 1.05rem; line-height: 1.3; }
.pg-stage {
  --size: max(180px, min(520px, calc((100vw - 2 * var(--gutter) - 64px) / 2), calc(100svh - 314px)));
  display: grid; grid-template-columns: var(--size) auto var(--size); gap: 14px; align-items: center; justify-content: center;
}
.pg-pick {
  position: relative; width: var(--size); aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer; display: block;
  background: #000; border: 1px solid var(--hair); box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--hair-dim), 0 14px 34px rgba(0, 0, 0, 0.6);
  transition: border-color 0.15s, box-shadow 0.15s; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pg-pick:hover:not(:disabled), .pg-pick:focus-visible { border-color: var(--gold-hi); }
.pg-pick:disabled { cursor: default; }
.pg-pick.wait { background: repeating-linear-gradient(45deg, #0a0a0b, #0a0a0b 8px, #0e0e10 8px, #0e0e10 16px); }
.pg-frame, .pg-img { display: block; width: 100%; height: 100%; }
.pg-img { object-fit: cover; transition: opacity 0.2s, filter 0.2s; user-select: none; -webkit-user-drag: none; }
.pg-pick.won { border-color: var(--neon); box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--neon), 0 0 34px rgba(204, 255, 0, 0.28); }
.pg-pick.lost .pg-img { opacity: 0.4; filter: grayscale(0.5); }
.pg-tag { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 9px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.88) 55%); color: #fff8e6; font: 500 0.95rem/1.2 var(--numf); text-align: center; }
.pg-tag:empty { display: none; }
.pg-pick.won .pg-tag { color: var(--neon-soft); }
.pg-or { font: 600 1rem var(--display); color: var(--dim); }
/* Neither: a third answer, plainly the lesser of the three things to press. Both pictures keep their light, and neither gets the crown. */
.pg-tie {
  min-height: 36px; padding: 6px 16px; cursor: pointer; background: none; border: 1px solid var(--hair-dim); color: var(--dim);
  font: 600 0.92rem/1 var(--display); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pg-tie:hover:not(:disabled), .pg-tie:focus-visible { color: var(--bone); border-color: var(--gold); }
.pg-tie:disabled { opacity: 0.45; cursor: default; }
.pg-pick.tied { border-color: var(--gold-hi); box-shadow: 0 0 0 3px var(--ground), 0 0 0 4px var(--gold), 0 0 26px rgba(201, 160, 63, 0.22); }
.pg-mini.tied img, .pg-mini.tied .pg-nopic { border-color: var(--gold); }
.pg-say { min-height: 3.1em; max-width: 60ch; text-align: center; font-size: 1.05rem; }
.pg-count { color: var(--dim); text-align: center; }
.pg-count b { font-family: var(--numf); }
/* The last few picks, one row a vote and the newest on top: the pair side by side at any width, the pick lit and the
   other dimmed as on the stage, and beside it what was picked and predicted. */
.pg-history { --mini: 72px; width: 100%; max-width: 540px; display: grid; gap: 10px; align-content: start; min-height: calc(var(--mini) + 3.4rem); margin-top: 6px; }
.pg-past-head { font-size: 0.95rem; color: var(--dim); font-weight: 600; letter-spacing: 0; text-align: center; }
.pg-past-none { color: var(--dim); font-size: 0.9rem; text-align: center; }
.pg-past { list-style: none; display: grid; gap: 10px; }
.pg-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--hair-dim); }
.pg-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pg-pair { display: grid; grid-template-columns: repeat(2, var(--mini)); gap: 6px; }
.pg-mini { display: block; }
.pg-mini img, .pg-nopic { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; border: 1px solid var(--hair-dim); }
.pg-mini.won img, .pg-mini.won .pg-nopic { border-color: var(--neon); box-shadow: 0 0 0 1px var(--neon), 0 0 14px rgba(204, 255, 0, 0.25); }
.pg-mini.lost img { opacity: 0.4; filter: grayscale(0.5); }
.pg-mini:hover img, .pg-mini:focus-visible img { border-color: var(--gold-hi); }
.pg-info { display: grid; gap: 3px; min-width: 0; font-size: 0.95rem; line-height: 1.35; }
.pg-info a { font-family: var(--numf); }
.pg-lean { color: var(--dim); font-size: 0.88rem; }
.pg-note { max-width: 70ch; text-align: center; color: var(--dim); font-size: 0.9rem; }
.pg-taste { width: 100%; }
@media (hover: none), (pointer: coarse) { .pg-keys { display: none; } }
/* Narrow and upright: one above the other, both in view at once (views/pageant.js asks the same question). */
@media (max-width: 599px) and (orientation: portrait) {
  .pg { gap: 8px; }
  .pg-stage { --size: max(150px, min(calc(100vw - 2 * var(--gutter)), calc((100svh - 270px) / 2))); grid-template-columns: var(--size); gap: 6px; justify-items: center; }
  .pg-or { line-height: 1; }
  .pg-say { min-height: 4.6em; }
  .pg-history { --mini: 60px; }
  .pg-row { gap: 12px; }
}

/* ---- before the first answer */
.clouded { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 70px 0; }
.clouded h1 { font-size: 1.7rem; }
.clouded p { color: var(--dim); max-width: 52ch; }
.stone.big { width: 96px; height: 96px; cursor: default; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { filter: brightness(0.55); } }

.foot { margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--hair-dim); color: var(--dim); font-size: 0.95rem; display: grid; gap: 8px; max-width: 90ch; }
.noscript { padding: 40px 16px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
