/* Inventory page only (index.html). Tokens and shared components come from style.css. */

:root {
  --well: color-mix(in srgb, var(--lapis-950) 60%, transparent); /* sunken rows inside a card */
  --era-neo: #9fb6e8;
  --era-requiem: #d77a6c;
}

/* One width for every view, so switching tabs never moves the page; relic cards get room on wide screens */
body:has(> nav.views) { max-width: 96rem; }

/* ---------- view switcher: a Farm group and a Sell group ---------- */

.views-group {
  flex: none;
  align-self: center;
  padding: 0 var(--sp-2) 0 var(--sp-1);
  color: var(--gold);
  font: 600 var(--step--2)/1 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  user-select: none;
}
.views-group:not(:first-child) { margin-left: var(--sp-3); padding-left: var(--sp-4); border-left: 1px solid var(--hairline); }

/* ---------- filter bar: search, the view's filters, sort last ---------- */

.tools.filters { margin: 0 0 var(--sp-4); }
.tools.filters .search input { width: min(16rem, 100%); }
.tools.filters .search input:focus { width: min(19rem, 100%); }
.tools.filters > .tool { flex: 1 1 auto; gap: var(--sp-3) var(--sp-4); }
.tools.filters .tool .sort { margin-left: auto; }
.tools.filters .range input[type="number"] { width: 4.75rem; }
.tools.filters .range > span { color: var(--muted); }

/* ---------- panels: squad relics and void fissures ---------- */

.squad .n, .fissures .n {
  display: inline-block;
  min-width: 1.5rem;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 2px;
  background: var(--lapis-800);
  font: 600 var(--step--1)/1.5 var(--num);
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}
.squad .n:empty, .fissures .n:empty { display: none; }

/* ---------- void fissures ---------- */

.fissures { display: grid; margin: 0 0 var(--sp-5); padding: 0; }
.fissures[hidden] { display: none; }
#fissures-title { margin: 0; font: 400 var(--step-1)/1.25 var(--display); }

/* The whole heading folds the panel: it folds itself away while you are in a fissure mission */
.fold {
  all: unset;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-4);
  box-sizing: border-box;
  width: 100%;
  min-height: 3.5rem;
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  transition: color var(--fast) ease, background var(--fast) ease;
}
.fold:hover { color: var(--gold-hi); background: linear-gradient(180deg, var(--gold-soft), transparent); }
/* The chamfer would clip an outside ring */
.fold:focus-visible { outline: 2px solid var(--void); outline-offset: -4px; }
.fold-title { display: inline-flex; align-items: baseline; gap: var(--sp-2); }
#fissure-hint { font: 400 var(--step--1)/1.5 var(--ui); }
.fold .chev {
  align-self: center;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: -0.5rem;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform var(--mid) var(--ease);
}
.fold[aria-expanded="false"] .chev { transform: rotate(-45deg); }
.fissures-body {
  display: grid;
  grid-template-rows: 1fr;
  min-width: 0;
  transition: grid-template-rows var(--mid) var(--ease), opacity var(--mid) ease;
}
.fissures-inner { display: grid; gap: var(--sp-3); min-height: 0; min-width: 0; overflow: hidden; padding: 0 var(--sp-5); }
.fissures-inner > * { min-width: 0; }
.fissures.collapsed .fissures-body { grid-template-rows: 0fr; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .fissures-body, .fold .chev { transition: none; }
}

/* Kind, mission and planet pickers side by side; several can be selected in each */
.fissure-filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.fissure-filters label { display: grid; flex: 1 1 10rem; gap: var(--sp-1); color: var(--muted); font: 600 var(--step--2)/1.4 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; }
.fissure-filters select { width: 100%; padding: var(--sp-1); font: 400 var(--step--1)/1.5 var(--ui); letter-spacing: 0; text-transform: none; }
.fissure-filters select option { padding: 0.15rem var(--sp-2); border-radius: 2px; }
.fissure-filters select option:checked { background: var(--gold-soft); color: var(--gold-hi); }
#fissure-filter-help { margin: 0; font-size: var(--step--2); }
.fissure-notifications { padding: var(--sp-3) 0; border-block: 1px solid var(--line-soft); font-size: var(--step--1); }
.fissure-notifications summary { cursor: pointer; color: var(--gold-hi); }
.fissure-notifications fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: var(--sp-3); min-width: 0; }
.fissure-notifications form { display: grid; gap: var(--sp-3); min-width: 0; }
.notification-setup-picker { display: grid; gap: var(--sp-1); max-width: 28rem; }
.notification-setup-picker :is(input, select) { width: 100%; min-width: 0; }
.notification-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.fissure-notifications .quiet { font-size: var(--step--2); }

/* New matching fissures: a banner pinned to the top of the page */
.fissure-alert {
  position: sticky;
  top: var(--sp-2);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--void) 45%, transparent);
  border-left: 3px solid var(--void);
  background: color-mix(in srgb, var(--lapis-900) 92%, var(--void));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  color: var(--ivory);
  font-size: var(--step--1);
}
.fissure-alert[hidden] { display: none; }
.fissure-alert button { flex: none; }
.chips .cn { margin-left: 0.35rem; font-family: var(--num); color: var(--muted); }

.fissure-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--sp-2);
  margin: 0 0 var(--sp-5);
  padding: 0;
  list-style: none;
}
.fissure-list .none {
  grid-column: 1 / -1;
  padding: var(--sp-4);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: var(--step--1);
  text-align: center;
}

.fissure {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "tier mission sets" "tier node node" "tier tags tags";
  gap: 0.05rem 0.6rem;
  width: 100%;
  height: 100%;
  padding: 0.5rem 0.7rem 0.5rem 0.5rem;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--era);
  border-radius: var(--r-ctl);
  background: linear-gradient(90deg, color-mix(in srgb, var(--era) 10%, transparent), var(--well) 5rem);
  text-align: left;
  font-size: var(--step--1);
  line-height: 1.35;
  cursor: pointer;
  transition: border-color var(--fast) ease, background var(--mid) ease, box-shadow var(--mid) ease, opacity var(--mid) ease;
}
.fissure:hover { border-color: var(--line-hover); border-left-color: var(--era); }
.fissure[aria-pressed="true"] {
  border-color: var(--era);
  background: linear-gradient(90deg, color-mix(in srgb, var(--era) 24%, transparent), var(--well) 8rem);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--era) 40%, transparent), inset 0 0 18px color-mix(in srgb, var(--era) 16%, transparent);
}
.fissure.useless:not([aria-pressed="true"]) { opacity: 0.55; }
.fissure .tier {
  grid-area: tier;
  align-self: center;
  min-width: 4.2rem;
  color: var(--era);
  font: 600 var(--step--1) var(--num);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fissure .fm { grid-area: mission; color: var(--ivory); font-weight: 500; }
.fissure .fn { grid-area: node; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fissure .fs { grid-area: sets; font-family: var(--num); color: var(--void); }
.fissure.useless .fs { color: var(--muted); }
.fissure .tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.fissure .time { font-family: var(--num); color: var(--muted); }
.fissure .tag { padding: 0 0.4rem; border-radius: 2px; font-size: var(--step--2); }
.fissure .tag.sp { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.fissure .tag.storm { background: var(--void-soft); color: var(--void); }

.fissure[data-tier="lith"] { --era: var(--intact); }
.fissure[data-tier="meso"] { --era: var(--exceptional); }
.fissure[data-tier="neo"] { --era: var(--era-neo); }
.fissure[data-tier="axi"] { --era: var(--flawless); }
.fissure[data-tier="requiem"] { --era: var(--era-requiem); }
.fissure[data-tier="omnia"] { --era: var(--void); }

/* ---------- set and relic cards ---------- */

/* One column on small screens, side by side once two cards fit */
.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(32rem, 100%), 1fr));
  gap: var(--sp-4);
}

.set {
  position: relative;
  padding: 1.25rem;
  border: 1px solid var(--hairline);
  box-shadow: var(--edge), inset 0 0 0 1px color-mix(in srgb, var(--lapis-950) 35%, transparent);
  transition: border-color var(--mid) ease;
}
.set:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }

.set-head { display: flex; align-items: center; gap: 0.9rem; }
.set-head h2 { margin: 0; font: 400 var(--step-1)/1.25 var(--display); letter-spacing: 0.01em; }
.set-head .meta { margin: 0.15rem 0 0; font-size: var(--step--1); color: var(--muted); }
.set-head .meta b { color: var(--ivory); font-weight: 500; }

.completion-hint { grid-column: 1 / -1; margin: 0; font-size: var(--step--1); }
.pending-loot { grid-column: 1 / -1; }
.pending-loot .pending-label { margin: 0; }
.pending-loot .finishes { margin-top: 0.5rem; }
.list > .empty { grid-column: 1 / -1; }

/* Mission-readable cards: a few big numbers, then chips */
.stats { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin: 0.9rem 0 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { color: var(--muted); font-size: var(--step--1); }
.stats dd { margin: 0; font: 600 var(--step-2)/1.1 var(--num); font-variant-numeric: tabular-nums; color: var(--ivory); }
.stats .plat dd { color: var(--gold-hi); }

/* A relic card: its refinement colours the cut corner and a bar along the top */
.relic-card { --cut-line: var(--ref); }
.relic-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--ref), transparent 70%);
}
.relic-head { display: flex; align-items: baseline; gap: 0.6rem; }
.relic-head h2 { margin: 0; font: 400 var(--step-2)/1.2 var(--display); }
.relic-head .rf { color: var(--ref); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; }
.relic-head .rc { margin-left: auto; font: 500 var(--step-1) var(--num); color: var(--muted); }
.relic-card[data-ref="intact"] { --ref: var(--intact); }
.relic-card[data-ref="exceptional"] { --ref: var(--exceptional); }
.relic-card[data-ref="flawless"] { --ref: var(--flawless); }
.relic-card[data-ref="radiant"] { --ref: var(--radiant); }

.finishes { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 0; padding: 0; list-style: none; }
.finishes li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.6rem 0.2rem 0.25rem;
  border-radius: var(--r-ctl);
  background: var(--well);
  font-size: var(--step--1);
}
.finishes img { width: 1.6rem; height: 1.6rem; object-fit: contain; }
.finishes .fn { color: var(--ivory); font-weight: 500; }
.finishes .fp { color: var(--gold-hi); font-family: var(--num); }
.finishes .fc { color: var(--muted); font-family: var(--num); }
.upgrade { margin: 0.7rem 0 0; font-size: var(--step--1); color: var(--muted); }
.upgrade b { color: var(--gold-hi); font-weight: 500; text-transform: capitalize; }

.almost-card .set-head > div, .craft-card .set-head > div { flex: 1; min-width: 0; }
.almost-card .price, .craft-card .price { font: 600 var(--step-2) var(--num); color: var(--gold-hi); }
.almost-card .need, .craft-card .need { margin: 0.15rem 0 0; color: var(--muted); }
.almost-card .need b, .craft-card .need b { color: var(--void); font-weight: 600; }
.almost-card .copy { margin-left: 0.5rem; font: 500 var(--step--1) var(--ui); color: var(--muted); }
.almost-card .relics { margin-top: 0.8rem; }
.almost-card .none { margin: 0.8rem 0 0; color: var(--muted); font-size: var(--step--1); }

.relics { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }

.relic {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.25rem 0.6rem 0.25rem 0.5rem;
  border-radius: var(--r-ctl);
  background: linear-gradient(90deg, color-mix(in srgb, var(--ref) 14%, transparent), var(--well) 3rem);
  border-left: 3px solid var(--ref);
  transition: background var(--mid) ease;
}
.relic:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--ref) 24%, transparent), var(--well) 4rem); }
.relic.new { animation: pop 360ms var(--ease) backwards; }
.relic .rn { color: var(--ivory); font-weight: 500; }
.relic .rf { color: var(--ref); }
.relic .rc { font-family: var(--num); color: var(--muted); }
.relic .rp { font-family: var(--num); color: var(--ivory); }

.relic[data-ref="intact"] { --ref: var(--intact); }
.relic[data-ref="exceptional"] { --ref: var(--exceptional); }
.relic[data-ref="flawless"] { --ref: var(--flawless); }
.relic[data-ref="radiant"] { --ref: var(--radiant); }

/* ---------- complete sets ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
  gap: var(--sp-4);
}

.complete .set-head { align-items: flex-start; }
.complete .count {
  margin-left: auto;
  font: 600 var(--step-2)/1 var(--num);
  color: var(--gold);
  text-shadow: 0 0 18px color-mix(in srgb, var(--gold) 35%, transparent);
}
.complete .compare {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1rem;
  margin: 1rem 0 0;
  font-size: var(--step--1);
}
.complete .compare dt { color: var(--muted); }
.complete .compare dd { margin: 0; text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; }
.complete .compare .best { color: var(--gold); }

.flags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }

/* Listing a complete set on warframe.market (once connected on the orders page) */
.sell-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--step--1);
  color: var(--muted);
}
.sell-line b { color: var(--gold); font: 600 var(--step-0) var(--num); }
.sell-line a { text-decoration: none; }
.sell-line a:hover { text-decoration: underline; }
.sell-line label { display: flex; align-items: center; gap: 0.3rem; font-family: var(--num); }
.sell-line input.num { width: 4.75rem; }
.sell-error { flex-basis: 100%; margin: 0; color: var(--danger); }
.connect { margin: 0 0 var(--sp-4); color: var(--muted); font-size: var(--step--1); }

/* ---------- ducats: spare prime parts worth trading in at Baro's kiosk ---------- */
.tools.filters .tool .ducat-rule { flex-basis: 100%; margin: 0; font-size: var(--step--1); }
.tool[data-for="ducats"] input.num { width: 4.5rem; }
.ducat-head { margin: 0 0 var(--sp-4); }
.ducat-head .stats { margin: 0 0 var(--sp-2); }
.ducat-head p { margin: 0; font-size: var(--step--1); max-width: 70ch; }
table.ducats tr.suggested td:first-child { box-shadow: inset 2px 0 0 var(--gold); }

/* ---------- squad relics (fissure mission in progress) ---------- */

.squad {
  --cut-line: var(--void);
  display: grid;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-5);
  border-color: color-mix(in srgb, var(--void) 40%, var(--line-soft));
  box-shadow: var(--edge), inset 0 0 32px var(--void-soft);
}
.squad[hidden] { display: none; }
.squad .panel-head { margin: 0; }
.squad .eyebrow { color: var(--void); }
.squad .panel-head p { max-width: 40rem; }
.squad .panel-head b { color: var(--ivory); font-weight: 600; }

/* Scrolled past, the panel pins itself to the top as a bar: each relic and only the drops you need */
.squad.compact {
  --cut: 8px;
  --fill: color-mix(in srgb, var(--lapis-900) 92%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem 0.6rem;
  border-top-width: 0;
  backdrop-filter: blur(10px);
  animation: rise 280ms var(--ease);
}
.squad.compact .eyebrow { display: none; }
.squad.compact .panel-head h2 { font-size: var(--step-0); }
.squad.compact .squad-list { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.4rem; }
.squad.compact .member { gap: 0.25rem; padding: 0.35rem 0.55rem 0.45rem; border-top-width: 2px; }
.squad.compact .member.reveal, .squad.compact .member.reveal::after { animation: none; }
.squad.compact .member h3 { font-size: var(--step--1); }
.squad.compact .member h3 + .mr { margin-top: -0.2rem; }
.squad.compact .mv, .squad.compact .reward:not(.wanted) { display: none; }
.squad.compact .reward { grid-template-columns: 1.2rem 1fr auto auto; }
.squad.compact .reward img { width: 1.2rem; height: 1.2rem; }

.squad-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16.5rem, 100%), 1fr));
  gap: var(--sp-3);
}

.member {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem 0.8rem;
  border: 1px solid var(--line-soft);
  border-top: 3px solid var(--ref, var(--line));
  border-radius: var(--r-ctl);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ref, var(--line)) 12%, transparent), var(--well) 4rem);
  font-size: var(--step--1);
  transition: border-color var(--mid) ease;
}
.member:hover { border-color: color-mix(in srgb, var(--ref, var(--line)) 45%, var(--line-soft)); }
.member[data-ref="intact"] { --ref: var(--intact); }
.member[data-ref="exceptional"] { --ref: var(--exceptional); }
.member[data-ref="flawless"] { --ref: var(--flawless); }
.member[data-ref="radiant"] { --ref: var(--radiant); }
.member h3 { display: flex; align-items: baseline; gap: 0.4rem; margin: 0; font: 600 var(--step-0)/1.3 var(--ui); overflow-wrap: anywhere; }
.member .you { padding: 0 0.4rem; border-radius: 2px; background: var(--gold-soft); color: var(--gold-hi); font-size: var(--step--2); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.member .mr { margin: 0; color: var(--muted); }
.member .mr .rn { color: var(--ivory); font-weight: 500; }
.member .mr .rf { color: var(--ref); text-transform: capitalize; }
.member .mv { margin: 0; color: var(--muted); }
.member .mv b { font-family: var(--num); color: var(--void); font-weight: 600; }

.rewards { display: grid; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
.reward {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0.35rem 0.15rem 0.2rem;
  border-left: 2px solid var(--rar);
  border-radius: 2px;
  background: var(--well);
}
.reward[data-rarity="common"] { --rar: var(--intact); }
.reward[data-rarity="uncommon"] { --rar: var(--exceptional); }
.reward[data-rarity="rare"] { --rar: var(--flawless); }
.reward img { width: 1.6rem; height: 1.6rem; object-fit: contain; }
.reward .wn { min-width: 0; line-height: 1.25; }
.reward .wn small { display: block; color: var(--muted); font-size: var(--step--2); }
.reward .wn small.need { color: var(--void); }
.reward .wc { font-family: var(--num); color: var(--muted); }
.reward .wp { min-width: 2.6rem; text-align: right; font-family: var(--num); font-weight: 600; color: var(--ivory); }
.reward.dearest .wp { color: var(--gold-hi); }
.reward.wanted { background: linear-gradient(90deg, color-mix(in srgb, var(--void) 18%, transparent), var(--well) 70%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--void) 25%, transparent); }
/* Squad mates who use this server: a violet frame and badge, and the rewards that finish their sets */
.member.platform { border-color: color-mix(in srgb, var(--mate) 55%, var(--line-soft)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mate) 25%, transparent), 0 0 18px -8px var(--mate); background: linear-gradient(180deg, color-mix(in srgb, var(--mate) 16%, transparent), var(--well) 4.5rem); }
.member, .finishes li { --mate: #b48ef0; }
.member .mate { padding: 0 0.4rem; border-radius: 2px; background: color-mix(in srgb, var(--mate) 20%, transparent); color: var(--mate); font-size: var(--step--2); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.reward .wn small.need.mate { color: var(--mate); }
.reward.mate-wanted { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mate) 35%, transparent); }
.finishes li.mate { border-color: color-mix(in srgb, var(--mate) 45%, var(--line-soft)); }
.finishes .who { margin-left: 0.35rem; color: var(--mate); font-size: var(--step--2); }
.member .none { margin: 0; color: var(--muted); }
.member.waiting .none { animation: blink 1.4s ease-in-out infinite alternate; }

/* A relic seen for the first time cracks open: a flash of its refinement's colour sweeps across the
   card, then its rewards drop in one after another and the parts you need glow once */
.member.reveal { animation: relic-open 1.1s var(--ease); }
.member.reveal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, color-mix(in srgb, var(--ref) 30%, transparent) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: relic-sweep 900ms 80ms var(--ease) forwards;
}
.member.reveal .reward { animation: rise 420ms calc(160ms + var(--i) * 60ms) var(--ease) backwards; }
.member.reveal .reward.wanted {
  animation: rise 420ms calc(160ms + var(--i) * 60ms) var(--ease) backwards, wanted 1.4s calc(520ms + var(--i) * 60ms) ease-in-out;
}
@keyframes relic-open {
  from { box-shadow: 0 0 0 1px var(--ref), 0 0 28px color-mix(in srgb, var(--ref) 50%, transparent); }
}
@keyframes relic-sweep { to { transform: translateX(100%); } }
@keyframes wanted {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  40% { box-shadow: 0 0 14px 0 color-mix(in srgb, var(--void) 45%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--void) 50%, transparent); }
}

.pending-label { color: var(--ok); font-size: var(--step--1); margin: 0.8rem 0 0; }

/* ---------- to craft ---------- */

.craft-card.ready { --cut-line: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.craft-card.ready .need b { color: var(--gold-hi); }

@media (prefers-reduced-motion: reduce) {
  .member.waiting .none, .member.reveal::after { animation: none !important; }
}

/* Selection hints: keyboard modifiers with a mouse, taps on a touch screen */
@media (hover: none) { .hint-mouse { display: none; } }
@media (hover: hover) { .hint-touch { display: none; } }

/* ---------- tablet and phone ---------- */

@media (max-width: 64rem) {
  .tools.filters .tool .sort { margin-left: 0; }
  /* The two groups stay on one line and scroll sideways */
  .views { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .views::-webkit-scrollbar { display: none; }
  .views button { flex: none; }
}

@media (max-width: 40rem) {
  .views-group { padding-right: var(--sp-1); }
  .views-group:not(:first-child) { margin-left: var(--sp-2); padding-left: var(--sp-3); }

  /* Filters stack: each one a full-width row, its control on the right */
  .tools.filters { padding: var(--sp-3); }
  .tools.filters .search input, .tools.filters .search input:focus { width: 100%; }
  .tools.filters > .tool { flex-basis: 100%; gap: var(--sp-2); }
  .tools.filters .tool > label:not(.check), .tools.filters .tool > .range { flex: 1 1 100%; justify-content: space-between; }
  .tools.filters .tool > label select { flex: 0 1 13rem; min-width: 0; }
  .tools.filters .range legend { margin-right: auto; }
  #riven-refresh { flex: 1 1 100%; }

  /* Chip rows scroll sideways instead of stacking up */
  #tags { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #tags::-webkit-scrollbar { display: none; }
  #tags button { flex: none; }
  .fissure-filters label { flex-basis: 100%; }
  .tools.filters .tool[data-for="items"] { flex-wrap: nowrap; min-width: 0; }
  #tags { min-width: 0; }

  .fold { padding: var(--sp-3) var(--sp-4); }
  .fissures-inner { padding: 0 var(--sp-4); }
  /* Fissures in two rows that scroll sideways, so the sets stay close below */
  .fissure-list {
    grid-template-columns: none;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: min(15rem, 80%);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    padding-bottom: var(--sp-2);
    margin-bottom: var(--sp-4);
  }
  .fissure-list li { scroll-snap-align: start; }
  .fissure-list:has(> .none) { grid-template-rows: auto; grid-auto-columns: 100%; }

  .squad { padding: var(--sp-3); }
  .set { padding: var(--sp-4); }
  .stats { gap: var(--sp-2) var(--sp-4); }
  .stats dd { font-size: var(--step-1); }
  .relic-head h2 { font-size: var(--step-1); }
}

/* Relics view: the refinement colours its name, rewards fold under the relic */
.relic-table tr[data-ref="intact"] { --ref: var(--intact); }
.relic-table tr[data-ref="exceptional"] { --ref: var(--exceptional); }
.relic-table tr[data-ref="flawless"] { --ref: var(--flawless); }
.relic-table tr[data-ref="radiant"] { --ref: var(--radiant); }
.relic-table .rf { color: var(--ref); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; }
.relic-rewards { margin-top: 0.3rem; font-size: var(--step--1); }
.relic-rewards summary { color: var(--muted); cursor: pointer; }
.relic-rewards ul { margin: 0.3rem 0 0; padding: 0; list-style: none; }
.relic-rewards li { padding-left: 0.4rem; border-left: 2px solid var(--rar, var(--line)); }
.relic-rewards li[data-rarity="common"] { --rar: var(--intact); }
.relic-rewards li[data-rarity="uncommon"] { --rar: var(--exceptional); }
.relic-rewards li[data-rarity="rare"] { --rar: var(--flawless); }
.relic-rewards .rarity { color: var(--rar); text-transform: capitalize; }
