/* NFT tab: Mint | Collection | Info, token page, filter sheet, header wallet panel. Tokens from base.css; see DESIGN.md. */


/* ---------- shared bits ---------- */
/* keeps the footer below the fold before the script shows a view (no layout shift on load) */
.nft { display: block; min-height: calc(100svh - var(--top) - var(--sub)); }
.icon-btn {
  appearance: none; border: 0; padding: 0; background: transparent; cursor: pointer; flex: none;
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%;
  color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color .15s ease-out, transform .12s ease-out;
}
.icon-btn svg, .step svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.icon-btn:active { transform: scale(.97); }
.icon-btn[disabled] { opacity: .35; cursor: default; transform: none; }
button.link { appearance: none; border: 0; padding: 0 0 2px; color: var(--ink); cursor: pointer; font-size: var(--t-small); }
@media (hover: hover) and (pointer: fine) { .icon-btn:not([disabled]):hover { background: rgb(255 255 255 / .7); } }
[hidden] { display: none !important; }
.no { white-space: nowrap; }

/* ================================================================
   MINT
   ================================================================ */
.mint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 452px);
  gap: var(--s-12);
  min-height: max(580px, calc(100svh - var(--top) - var(--sub) - 95px)); /* 95 = footer */
  padding-top: var(--s-6);
}

/* the set: soft wall light and a floor that fades at its edges (sides and bottom: no hard band at the footer) */
.stage { position: relative; min-height: 420px; }
.stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(46% 52% at 46% 56%, var(--key) 0%, rgb(247 247 248 / .55) 45%, rgb(247 247 248 / 0) 100%);
}
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
  background:
    radial-gradient(38% 40% at 50% 64%, rgb(247 247 248 / .9), rgb(247 247 248 / 0) 100%),
    linear-gradient(to bottom, rgb(224 224 224 / 0) 0%, var(--floor-far) 34%, var(--floor-near) 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 24%, #000 76%, transparent 100%), linear-gradient(to bottom, #000 62%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, #000 24%, #000 76%, transparent 100%), linear-gradient(to bottom, #000 62%, transparent 100%);
  mask-composite: intersect;
}
.hero {
  position: absolute; left: 50%; bottom: 72px; z-index: 2;
  transform: translateX(-50%);
  border-radius: 0;
}
.hero:focus-visible { outline: none; }
.hero:focus-visible .pet canvas { outline: 2px solid var(--ink); outline-offset: 6px; border-radius: var(--r); }
.pet { --s: 6; position: relative; display: block; margin-bottom: calc(var(--s) * -4px); }
.pet canvas { display: block; position: relative; z-index: 1; image-rendering: pixelated; image-rendering: crisp-edges; transition: transform .26s var(--ease); }
/* two-layer contact shadow: a tight core where the shell meets the floor, a wide soft falloff */
.pet::before, .pet::after { content: ''; position: absolute; z-index: 0; pointer-events: none; border-radius: 50%; }
.pet::after {
  left: 14%; right: 14%;
  bottom: calc(var(--s) * 4px - var(--s) * 1.6px);
  height: calc(var(--s) * 3.2px);
  background: radial-gradient(closest-side, rgb(var(--shade) / .5), rgb(var(--shade) / .2) 60%, rgb(var(--shade) / 0));
  filter: blur(calc(var(--s) * .5px));
  transform: translateX(4%);
}
.pet::before {
  left: 2%; right: 2%;
  bottom: calc(var(--s) * 4px - var(--s) * 5px);
  height: calc(var(--s) * 10px);
  background: radial-gradient(closest-side, rgb(var(--shade) / .16), rgb(var(--shade) / 0));
  transform: translateX(4%);
}
@media (hover: hover) and (pointer: fine) { .hero:hover .pet canvas { transform: translateY(calc(var(--s) * -1px)); } }
.hero-cap {
  position: absolute; left: 0; right: 0; bottom: var(--s-6); z-index: 2;
  display: flex; justify-content: center; gap: var(--s-4); white-space: nowrap;
  font-size: var(--t-small); color: var(--ink-2);
}
.hero-cap .no { color: var(--ink); font-weight: 500; }

/* wide screens: the stage is as tall as the pet needs (js sizeHero sets --stage-h) and sits on the same centre line
   as the column, so a tall screen never leaves the pet anchored under a dead band */
@media (min-width: 960px) { .stage { align-self: center; height: var(--stage-h, auto); } }

/* the column on the right */
.mint-side { align-self: center; display: flex; flex-direction: column; padding: var(--s-4) 0; }
.status { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-small); color: var(--ink-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.status[data-state='live'] { color: var(--ink); font-weight: 500; }
.status[data-state='live'] .status-dot { background: var(--ink); box-shadow: none; }
.status[data-state='soldout'] .status-dot, .status[data-state='closed'] .status-dot { background: var(--ink-3); box-shadow: none; }

.clock { display: flex; gap: var(--s-6); align-items: baseline; margin-top: var(--s-3); }
.cu { display: inline-flex; align-items: baseline; gap: var(--s-1); }
.cu b { font-weight: 500; font-size: clamp(40px, 2vw + 22px, 56px); line-height: 1; letter-spacing: -0.03em; }
.cu i { font-style: normal; font-size: var(--t-small); color: var(--ink-2); }

.progress { margin-top: var(--s-3); }
.progress-n { font-size: var(--t-h2); line-height: 1.1; letter-spacing: -0.02em; }
.progress-n .muted { font-size: var(--t-small); letter-spacing: 0; }
.bar { position: relative; height: 4px; margin-top: var(--s-3); border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.bar span { --p: 0; position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; transform: scaleX(var(--p)); transition: transform .4s var(--ease-out); }

.when { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-4); }
.when-time { font-size: var(--t-small); line-height: 1.45; font-weight: 500; }
.when-time .nw { white-space: nowrap; }
.when-utc { display: block; font-weight: 400; }

.mint-panel { margin-top: var(--s-6); padding: var(--s-6); display: flex; flex-direction: column; }
.mint-lead { font-weight: 500; }
.mint-note { margin-top: var(--s-1); font-size: var(--t-small); color: var(--ink-2); }
.mint-tba { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--t-small); color: var(--ink-2); }
.mint-known { margin-top: var(--s-4); }
.mint-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.mint-grid dt { font-size: var(--t-small); color: var(--ink-2); }
.mint-grid dd { margin: var(--s-1) 0 0; font-size: 19px; }
.stepper { display: inline-flex; align-items: center; gap: var(--s-3); }
.step {
  appearance: none; border: 0; padding: 0; background: transparent; cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
  display: inline-grid; place-items: center; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
}
.step svg { width: 12px; height: 12px; }
.step[disabled] { opacity: .35; cursor: default; }
.stepper output { min-width: 2ch; text-align: center; }
.mint-btn { width: 100%; margin-top: var(--s-6); }
.mint-msg { margin-top: var(--s-3); font-size: var(--t-small); font-weight: 500; text-align: center; }
.mint-safe { margin-top: var(--s-3); font-size: var(--t-small); color: var(--ink-2); text-align: center; }
.mint-msg:not([hidden]) + .mint-safe { margin-top: var(--s-1); }
.mint-more { margin-top: var(--s-4); font-size: var(--t-small); }

/* ================================================================
   COLLECTION
   ================================================================ */
.col { padding-top: var(--s-8); padding-bottom: var(--s-16); }
.col-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4) var(--s-8); }
.col-title { display: flex; align-items: baseline; gap: var(--s-4); }
/* the count leads the view (the sub bar already says Genesis and Collection) */
.col-count { font-size: 22px; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); }
.col-count .num { letter-spacing: -0.03em; }
.col-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

.search {
  position: relative; display: inline-flex; align-items: center; height: 40px; width: 148px;
  border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line-2); background: rgb(255 255 255 / .35);
  transition: box-shadow .15s ease-out, background-color .15s ease-out;
}
.search svg { position: absolute; left: 14px; width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 1.5; pointer-events: none; }
.search input {
  appearance: none; border: 0; background: transparent; outline: 0; width: 100%; height: 100%;
  padding: 0 var(--s-4) 0 40px; font: 500 var(--t-small)/1 var(--f-num); color: var(--ink);
}
.search input::placeholder { font-family: var(--f-sans); font-weight: 400; color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
/* same ring as every other control */
.search:focus-within { outline: 2px solid var(--ink); outline-offset: 4px; background: var(--surface-2); }

.seg { display: inline-flex; height: 40px; padding: var(--s-1); border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg button {
  appearance: none; border: 0; background: transparent; cursor: pointer; padding: 0 var(--s-4); border-radius: var(--r-pill);
  font-size: var(--t-small); font-weight: 500; color: var(--ink-2); transition: background-color .15s ease-out, color .15s ease-out;
}
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--on-ink); }
.seg button { position: relative; }
.seg button::before { content: ''; position: absolute; inset: calc(var(--s-1) * -1) 0; } /* hit area fills the track */
.seg button:focus-visible { outline-offset: -2px; border-radius: var(--r-pill); }
.seg button[aria-pressed='true']:focus-visible { box-shadow: inset 0 0 0 4px var(--on-ink); }
.chip { appearance: none; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.owned-chip { height: 40px; padding: 0 var(--s-4); font-size: var(--t-small); }
.filters-open { display: none; }
.filters-n:not(:empty) {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 var(--s-2); border-radius: var(--r-pill);
  background: var(--ink); color: var(--on-ink); font-size: 12px;
}
@media (hover: hover) and (pointer: fine) {
  .seg button[aria-pressed='false']:hover { color: var(--ink); }
  .chip[aria-pressed='false']:hover, .fchip:hover { background: rgb(255 255 255 / .6); color: var(--ink); }
}

.col-body { position: relative; display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--s-8); margin-top: var(--s-6); align-items: start; }
/* keyboard shortcut past the 60 filter controls; visible only while focused */
.skip-results {
  position: absolute; left: 0; top: 0; z-index: 5;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4);
  border-radius: var(--r-pill); background: var(--ink); color: var(--on-ink); font-size: var(--t-small); font-weight: 500;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-results:focus-visible { clip-path: none; outline-offset: 2px; }

/* filter list (sidebar on wide screens, bottom sheet on narrow ones).
   The scroller is padded so hover pills and focus rings are not clipped; the negative margin keeps the column edge. */
.filters {
  position: sticky; top: calc(var(--sub) + var(--s-4));
  max-height: calc(100svh - var(--sub) - var(--s-8)); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  padding: var(--s-1) var(--s-2) var(--s-1); margin: calc(var(--s-1) * -1) calc(var(--s-2) * -1) 0;
}
.filters-body { border-top: 1px solid var(--line); }
.fgroup { border-bottom: 1px solid var(--line); }
.fgroup summary {
  display: flex; align-items: center; gap: var(--s-2); height: 44px; cursor: pointer; list-style: none;
  padding: 0 var(--s-2); margin: 0 calc(var(--s-2) * -1); font-size: var(--t-small); font-weight: 500;
}
.fgroup summary:focus-visible { outline-offset: -2px; border-radius: 6px; }
.fgroup summary::-webkit-details-marker { display: none; }
.fg-name { flex: 1; }
.fg-n:not(:empty) {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 var(--s-2); border-radius: var(--r-pill);
  background: var(--ink); color: var(--on-ink); font-size: 12px;
}
.chev { width: 8px; height: 8px; margin: 0 var(--s-1) var(--s-1) var(--s-1); border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(45deg); transition: transform .2s var(--ease-out); }
.fgroup[open] .chev { transform: translateY(4px) rotate(-135deg); }
.fgroup fieldset { margin: 0; padding: 0 0 var(--s-3); border: 0; min-width: 0; }
.fval {
  position: relative; display: flex; align-items: center; gap: var(--s-3); min-height: 36px; padding: 0 var(--s-2);
  margin: 0 calc(var(--s-2) * -1); border-radius: var(--s-2); cursor: pointer; font-size: var(--t-small); color: var(--ink-2);
}
.fval input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.fval .box {
  flex: none; width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2);
  display: grid; place-items: center; transition: background-color .15s ease-out;
}
.fval .box::after { content: ''; width: 8px; height: 4px; margin-top: -2px; border-left: 1.5px solid var(--on-ink); border-bottom: 1.5px solid var(--on-ink); transform: rotate(-45deg); opacity: 0; }
.fval input:checked + .box { background: var(--ink); box-shadow: none; }
.fval input:checked + .box::after { opacity: 1; }
.fval input:checked ~ .fval-name { color: var(--ink); font-weight: 500; }
.fval input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 2px; }
.fval-name { flex: 1; min-width: 0; }
.fval-n { font-size: 13px; color: var(--ink-3); }
.fval.is-zero { color: var(--ink-3); }
.fval.is-zero .box { opacity: .5; }
@media (hover: hover) and (pointer: fine) { .fval:hover { background: rgb(255 255 255 / .55); color: var(--ink); } }

/* active filters */
.active { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-6); }
.active-list { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.fchip { color: var(--ink); padding-right: var(--s-2); }
.fchip svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.4; margin-left: 2px; }
.clear { font-size: var(--t-small); }

/* the grid. JS (layoutGrid) sets --cols / --tile / --gap so every tile shows whole device pixels per art pixel. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s-8) var(--s-6); margin: 0; padding: 0; list-style: none; }
/* --tracks: the first column is one tile wide, every other column is gap + tile with the tile at its end, so the
   tiles start on whole device pixels and the last one ends exactly at the toolbar's right edge (js layoutGrid) */
.grid[data-mode] { grid-template-columns: var(--tracks, repeat(var(--cols), var(--tile))); column-gap: 0; row-gap: var(--row-gap, var(--s-8)); }
.grid[data-mode] > li { width: var(--tile); justify-self: end; }
.grid:focus { outline: none; }
.grid > li { min-width: 0; }
.tile {
  appearance: none; border: 0; padding: 0; background: none; cursor: pointer; display: block; width: 100%; text-align: left; color: inherit;
  border-radius: var(--r); scroll-margin-top: calc(var(--sub) + var(--s-4)); scroll-margin-bottom: var(--s-4);
}
.tile .art, .skel .art { display: block; aspect-ratio: 1; background: var(--bg, var(--surface)); transition: transform .15s ease-out; }
.tile .art img { width: 100%; height: 100%; aspect-ratio: 1; }
.tile:focus-visible { outline-offset: 3px; }
.cap { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); margin-top: var(--s-2); font-size: var(--t-small); }
.cap .no { color: var(--ink); font-weight: 500; }
.cap-rank { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.cap-tk { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.tile:active .art { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .tile:hover .art { transform: translateY(-3px); } }
.skel-line { display: block; width: 60%; height: 12px; margin-top: var(--s-3); border-radius: var(--r-pill); background: var(--surface); }
.skel-line::after { content: ''; display: block; height: 30px; } /* same height as a real caption */

/* empty and error states: centred, one message, one action */
.empty {
  display: grid; justify-items: center; align-content: center; gap: var(--s-3); min-height: 360px;
  padding: var(--s-12) 0; text-align: center; color: var(--ink-2);
}
.empty-art { display: block; margin-bottom: var(--s-2); }
.empty-art canvas { display: block; image-rendering: pixelated; filter: brightness(0); opacity: .1; }
.empty-title { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.empty-text { font-size: var(--t-small); }
.empty .btn-ghost { margin-top: var(--s-2); }

/* ---------- filter sheet ---------- */
dialog.fsheet {
  width: 100%; max-width: 100%; max-height: 86svh; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0;
  flex-direction: column; overscroll-behavior: contain;
}
dialog.fsheet[open] { display: flex; animation: sheet-in .28s var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
.fsheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) var(--gut); border-bottom: 1px solid var(--line); }
.fsheet-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.fsheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--gut); }
.fsheet-body .filters-body { border-top: 0; }
.fsheet-body .filters-body .fgroup:last-child { border-bottom: 0; }
.fsheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) var(--gut) calc(var(--s-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
}
.fsheet-foot .btn { flex: 1; max-width: 240px; }

/* ---------- token page ---------- */
dialog.token {
  --tk-art: 512px; --tk-bg: var(--surface);
  overflow: hidden; overscroll-behavior: contain;
  width: min(calc(var(--tk-art) + 440px), calc(100vw - 2 * var(--gut)));
}
dialog.token[open] { animation: dlg-in .22s var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tk { display: grid; grid-template-columns: var(--tk-art) minmax(0, 1fr); max-height: calc(100svh - 48px); }
/* the art band: the token's own background colour behind a snapped square, never white bars */
.tk-art { display: grid; place-items: center; min-height: var(--tk-art); background: var(--tk-bg); }
.tk-art img { width: var(--tk-art); height: var(--tk-art); max-width: none; image-rendering: pixelated; }
.tk-info { display: flex; flex-direction: column; padding: var(--s-6); overflow-y: auto; min-height: 0; }
.tk-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.tk-top h2 { font-size: var(--t-h2); letter-spacing: -0.03em; }
.tk-top h2:focus { outline: none; }
.tk-nav { display: flex; gap: var(--s-2); }
.tk-key { margin: var(--s-4) 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.tk-key dt { font-size: var(--t-small); color: var(--ink-2); }
.tk-key dd { margin: var(--s-1) 0 0; font-size: 19px; }
.tk-key dd .muted { font-size: var(--t-small); }
.tk-traits { margin: var(--s-4) 0 0; display: grid; }
.tk-traits > div { display: flex; align-items: baseline; gap: var(--s-4); padding: var(--s-2) 0; border-top: 1px solid var(--line); font-size: var(--t-small); }
.tk-traits > div:last-child { border-bottom: 1px solid var(--line); }
.tk-traits dt { width: 96px; flex: none; color: var(--ink-2); }
.tk-traits dd { margin: 0; flex: 1; display: flex; justify-content: space-between; gap: var(--s-3); }
.tk-traits .tv { font-weight: 500; }
.tk-traits .tv.is-none { font-weight: 400; color: var(--ink-3); }
.tk-traits .tp { font-size: 13px; color: var(--ink-3); }
.tk-note { margin-top: var(--s-3); font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.tk-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: auto; padding-top: var(--s-4); }
.tk-actions .btn { flex: 1 1 auto; min-width: 0; }
.tk-actions .btn-ghost { flex: 0 1 auto; min-width: 0; }
.tk-rank-tie { font-size: var(--t-small); }

/* ================================================================
   INFO
   ================================================================ */
.info { padding-top: var(--s-8); padding-bottom: var(--s-12); }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-12); align-items: start; }
.info-col { display: grid; gap: var(--s-8); align-content: start; }
.block { container-type: inline-size; }
.block h3 { margin-bottom: var(--s-2); }
.spec.compact dt { white-space: nowrap; }
/* long values (two lines, sub text) stack under their label wherever the column is narrow, not only on phones */
@container (max-width: 379px) {
  .spec.compact > div.is-long { flex-wrap: wrap; row-gap: 2px; }
  .spec.compact > div.is-long dd { max-width: none; flex-basis: 100%; text-align: left; text-wrap: pretty; }
}
/* tablets (760 to 1279, incl. 1180x820 landscape): Info in three short parts (a switch like Number / Rarity), two columns each, so it fits one screen */
.info-parts { display: none; }
.spec.compact > div { padding: var(--s-2) 0; }
.spec.compact dd { max-width: 74%; text-wrap: balance; }
.block-note, .block-sub { margin-top: var(--s-3); font-size: var(--t-small); color: var(--ink-2); }
.block-text { font-size: var(--t-small); color: var(--ink-2); }
.block-links { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); margin-top: var(--s-4); font-size: var(--t-small); }
.powers { margin: var(--s-2) 0 0; padding: 0; list-style: none; display: grid; gap: var(--s-1); font-size: var(--t-small); color: var(--ink-2); }
.powers li { position: relative; padding-left: var(--s-4); }
.powers li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }
.powers .ans { display: block; color: var(--ink); font-weight: 500; }
.hash { display: inline-flex; align-items: baseline; gap: var(--s-3); }
.hash .num { font-size: 14px; }
.hash .num.is-full { word-break: break-all; user-select: all; -webkit-user-select: all; }
.hash .copy { font-size: 14px; }
.spec dd .sub { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.safety { text-wrap: balance; margin-top: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--s-2); background: var(--surface); border: 1px solid var(--line); font-size: var(--t-small); }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 40px; padding: var(--s-2) 0;
  cursor: pointer; list-style: none; font-size: var(--t-small); font-weight: 500;
}
.faq summary:focus-visible { outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .faq summary:hover { color: var(--ink-2); } }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; flex: none; width: 8px; height: 8px; margin-right: var(--s-1); border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease-out); }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { padding: 0 0 var(--s-3); font-size: var(--t-small); color: var(--ink-2); }

/* ================================================================
   TOUCH: 44px targets
   ================================================================ */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .step { width: 44px; height: 44px; }
  .search, .seg, .owned-chip, .filters-open, #add-cal, .empty .btn-ghost { height: 44px; }
  .fval { min-height: 44px; }
  .fgroup summary, .faq summary { min-height: 44px; }
  /* inline text controls: a taller hit area without moving the text or its underline */
  .hash .copy, .spec .link, .block-links .link, .mint-more .link, .fsheet-clear, .clear, .wp-copy, .wp-install .link { position: relative; }
  .hash .copy::before, .spec .link::before, .block-links .link::before, .mint-more .link::before,
  .fsheet-clear::before, .clear::before, .wp-copy::before, .wp-install .link::before {
    content: ''; position: absolute; left: -4px; right: -4px; top: 50%; height: 44px; transform: translateY(-50%);
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (min-width: 1600px) {
  .mint { grid-template-columns: minmax(0, 1fr) 520px; }
  .mint-lead { font-size: 19px; }
}
/* wide screens: the collection gets more room so the grid runs 6 columns of 192px */
@media (min-width: 1680px) {
  .frame.col { max-width: calc(1520px + 2 * var(--gut)); }
}

@media (max-height: 820px) and (min-width: 960px) {
  .mint { min-height: calc(100svh - var(--top) - var(--sub) - 95px); padding-top: var(--s-2); }
  .mint-side { padding: 0; }
  .mint-panel { margin-top: var(--s-4); padding: var(--s-4) var(--s-6) var(--s-6); }
  .mint-btn { margin-top: var(--s-4); }
  .info { padding-top: var(--s-6); }
}

@media (min-width: 760px) and (max-width: 1279px) {
  .info-parts { display: inline-flex; margin-bottom: var(--s-6); }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .info-col { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-12); align-items: start; }
  .info-col:not(.is-part) { display: none; }
}

@media (max-width: 959px) {
  .tk { grid-template-columns: minmax(0, 1fr); }
  .mint { grid-template-columns: 1fr; gap: 0; min-height: 0; padding-top: 0; }
  /* the pet is the hero on phones and tablets too */
  .stage { min-height: 0; height: clamp(300px, 46svh, 460px); }
  .floor { background: radial-gradient(38% 40% at 50% 60%, rgb(247 247 248 / .9), rgb(247 247 248 / 0) 100%), linear-gradient(to bottom, rgb(224 224 224 / 0) 0%, var(--floor-far) 34%, var(--floor-near) 72%, rgb(216 216 214 / 0) 100%); }
  .hero { bottom: 52px; }
  .hero-cap { bottom: var(--s-3); }
  .mint-side { padding-top: var(--s-4); }
  .filters-open { display: inline-flex; }
  .col-body { grid-template-columns: 1fr; }
  .filters, .skip-results { display: none; }
  dialog.token { width: 100%; max-width: 100%; max-height: 94svh; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; overflow-y: auto; }
  dialog.token[open] { animation: sheet-in .28s var(--ease-out); }
  .tk { grid-template-columns: 1fr; max-height: none; }
  .tk-art { min-height: 0; }
  .tk-info { overflow: visible; }
  .tk-actions { position: sticky; bottom: 0; margin: 0 calc(var(--s-6) * -1) calc(var(--s-6) * -1); padding: var(--s-3) var(--s-6) calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--surface-2); border-top: 1px solid var(--line); }
}
@media (min-width: 600px) and (max-width: 959px) {
  .tk-info { width: 100%; max-width: 600px; margin: 0 auto; }
  .tk-actions { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}

@media (max-width: 759px) {
  .mint-side { padding-bottom: var(--s-8); }
  .clock { justify-content: space-between; gap: var(--s-2); margin-top: var(--s-2); }
  .cu b { font-size: 40px; }
  .when { margin-top: var(--s-3); }
  .mint-panel { margin-top: var(--s-4); padding: var(--s-4); }
  .mint-btn { height: 52px; margin-top: var(--s-4); }
  .hero-cap { gap: var(--s-3); }

  .col { padding-top: var(--s-6); }
  .col-head { align-items: stretch; flex-direction: column; gap: var(--s-4); }
  /* row 1: search across; row 2: sort on the left, filters on the right */
  .col-tools { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3) var(--s-2); }
  .search { width: 100%; grid-column: 1 / -1; grid-row: 1; }
  .seg { grid-column: 1; grid-row: 2; justify-self: start; }
  .owned-chip { grid-column: 2; grid-row: 2; justify-self: start; }
  .filters-open { grid-column: 3; grid-row: 2; }
  .tile .art { border-radius: 10px; }
  /* tiles sit close on phones: keep the caption left-aligned so it never runs into the neighbour's */
  .cap { justify-content: flex-start; margin-top: var(--s-2); font-size: 14px; }
  .cap-rank, .cap-tk { font-size: 13px; }

  .info { padding-top: var(--s-6); }
  .info-grid { grid-template-columns: 1fr; gap: var(--s-8); }
  .tk-info { padding: var(--s-4); }
  .tk-actions { margin: 0 calc(var(--s-4) * -1) calc(var(--s-4) * -1); padding-left: var(--s-4); padding-right: var(--s-4); }
  .tk-traits dt { width: 88px; }
}

@media (max-width: 359px) {
  .cap-rank { font-size: 12px; }
}
@media (max-width: 399px) {
  /* token sheet on the smallest phones: both actions stay on one row, and wrap rather than clip */
  .tk-actions .btn, .tk-actions .btn-ghost { padding: 0 var(--s-4); }
  .tk-top { gap: var(--s-2); }
  .tk-top h2 { font-size: 26px; }
  .when-time { min-width: 0; }
}
/* very large screens: Mint gets the same wider frame as the collection, so the pet can grow */
@media (min-width: 2200px) {
  .frame.mint { max-width: calc(1520px + 2 * var(--gut)); }
  .mint { grid-template-columns: minmax(0, 1fr) 560px; }
}

@media (prefers-reduced-motion: reduce) {
  dialog.fsheet[open], dialog.token[open] { animation: none; }
  .pet canvas, .tile .art, .bar span, .chev, .faq summary::after { transition: none; }
  .hero:hover .pet canvas, .tile:hover .art, .tile:active .art, .icon-btn:active { transform: none; }
}
