/* PHOENIX's Survival Trials page (phoenix/trials/, phoenix/js/phoenix-trials.js): the maker, the fighter's card, The
   Farm's shelf and the sixteen. On phoenix.css's tokens. The sides wear one colour each: the Herd green, the Horde
   violet, the Mercenaries flame. */
.st { max-width: 1120px; margin: 0 auto; padding: calc(96px + env(safe-area-inset-top, 0px)) max(16px, 4vw, env(safe-area-inset-right, 0px)) calc(60px + env(safe-area-inset-bottom, 0px)) max(16px, 4vw, env(safe-area-inset-left, 0px)); --herd: #7be0a0; --horde: #c79bff; --merc: #ffb23e; }
.st .note { color: var(--muted); font-size: 14px; }
.st-head { margin-bottom: 18px; }
.st-head h1 { margin: 0 0 8px; font: 700 clamp(30px, 5vw, 46px)/1.05 var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.st-head .sub { margin: 0; max-width: 720px; color: var(--muted); }
.st-lead { margin: 0 0 16px; max-width: 760px; }
.st .panel + .panel, .st-maker > .panel + .panel { margin-top: 18px; }
.side-herd { --side: var(--herd); }
.side-horde { --side: var(--horde); }
.side-mercenary { --side: var(--merc); }

/* The maker: a filter, then a grid of portraits to pick from. */
.st-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.st-filter .chip { cursor: pointer; font-size: 13px; padding: 6px 12px; }
.st-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.st-pick { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; color: var(--muted); font: 600 12px/1.25 var(--sans); text-align: center; cursor: pointer; }
.st-pick .st-thumb { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.08); box-shadow: inset 0 -3px 0 var(--side); transition: transform 0.15s ease, border-color 0.15s ease; }
.st-pick:hover .st-thumb { transform: translateY(-2px); border-color: var(--side); }
.st-pick span { overflow-wrap: anywhere; hyphens: auto; }
.st-pick.on { color: var(--text); }
.st-pick[disabled] { opacity: 0.4; cursor: not-allowed; }
.st-pick[disabled]:hover .st-thumb { transform: none; border-color: rgba(255, 255, 255, 0.08); }
.st-pick.on .st-thumb { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 8px 26px rgba(255, 178, 62, 0.35); }
.st-pick:focus-visible { outline: none; }
.st-pick:focus-visible .st-thumb { box-shadow: 0 0 0 3px var(--flame); }
.st-name-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.st-name-row .field { flex: 1 1 260px; font-size: 18px; }
.st-hint { margin: 8px 0 0; }
.st-hint.bad { color: var(--bad); }

/* A fighter's card. */
.st-card { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 20px; padding: 16px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-top: 3px solid var(--side); margin: 10px 0 16px; }
.st-card-art { position: relative; align-self: start; }
.st-portrait { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }
.st-side { position: absolute; left: 8px; bottom: 8px; padding: 4px 9px; border-radius: 999px; background: rgba(11, 6, 8, 0.82); color: var(--side); font: 700 12px/1.2 var(--sans); letter-spacing: 0.04em; }
.st-name { margin: 0 0 2px; font: 700 clamp(22px, 3vw, 28px)/1.15 var(--display); letter-spacing: 0.03em; color: var(--text); text-transform: none; overflow-wrap: anywhere; }
.st .panel h2.st-name { display: block; font: 700 clamp(22px, 3vw, 28px)/1.15 var(--display); letter-spacing: 0.03em; color: var(--text); text-transform: none; }
.st-who { color: var(--side); font-weight: 700; margin-bottom: 10px; }
.st-stats { display: grid; gap: 6px; margin: 10px 0 14px; }
.st-stats > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; }
.st-stats dt { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.st-stats dd { margin: 0; display: flex; align-items: center; gap: 10px; }
.st-stats dd b { font-size: 13px; color: var(--text); min-width: 0; }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 18px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); }
.pips i.on { background: var(--side); }
.st-ability { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); margin-bottom: 12px; }
.st-ability b { color: var(--gold); }
.st-ability span { color: var(--muted); font-size: 14px; }
.st-kit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.st-kit .lbl { color: var(--dim); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 4px; }
.st-wpn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-hot); background: rgba(255, 106, 26, 0.08); color: var(--text); font-size: 13px; font-weight: 600; }
.st-wpn small { color: var(--dim); font-weight: 500; }
.st-wpn-ico { display: block; flex: 0 0 auto; width: 20px; height: 20px; object-fit: contain; }
.st-slot .st-wpn-ico, .st-opt .st-wpn-ico { width: 40px; height: 40px; }

/* Your fighter's sheet: the card, its inventory and its badges on the left; Seeds, what it carries, its frames and
   the sites showing it on the right. Each column stacks on its own, so neither waits on the other's height. */
.st-yours { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.st-main-col > .st-card { margin: 0; }
.st-main-col > * + *, .st-side-col > * + * { margin-top: 18px; }
/* The inventory: everything the fighter owns, two to a row, the packed ones lit. */
.st-inv { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.st-inv-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.st-inv-item.packed { border-color: var(--line-hot); background: rgba(255, 106, 26, 0.07); }
.st-inv-item .st-wpn-ico { width: 48px; height: 48px; }
.st-inv-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-inv-what small { color: var(--muted); }
.st-inv-what .st-tags { margin-top: 6px; }
.st-inv-what .chip { font-size: 11px; padding: 3px 8px; }
.st-big { font: 700 44px/1 var(--display); color: var(--gold); margin: 4px 0 8px; }
.st-seeds .btn { margin-top: 4px; }
.st-log { list-style: none; margin: 14px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.st-log li { padding: 4px 0; border-top: 1px solid var(--line); }
.st-log li span { color: var(--text); font-weight: 700; }
.st-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0 14px; }
.st-slot { min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 10px; border-radius: 12px; border: 1px dashed var(--line); color: var(--dim); font-size: 13px; }
.st-slot.full { flex-direction: row; align-items: center; gap: 10px; border: 1px solid var(--line-hot); background: rgba(255, 106, 26, 0.07); color: var(--text); }
.st-slot.full > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-slot.full small { color: var(--muted); }
.st-slot.wide { grid-column: span 2; }
.st-choose { display: grid; gap: 8px; margin: 8px 0 14px; }
.st-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.st-opt input { margin-top: 3px; accent-color: var(--flame); }
.st-opt span { display: flex; flex-direction: column; gap: 2px; }
.st-opt small { color: var(--muted); }
.st-opt.off { opacity: 0.5; cursor: not-allowed; }

/* The Farm. */
.st-farm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.st-farm-head > div:first-child { flex: 1 1 320px; }
.st-purse { text-align: right; }
.st-purse span { display: block; color: var(--dim); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.st-purse b { font: 700 38px/1 var(--display); color: var(--gold); }
.st-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0; }
.st-item { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.st-item-art { display: grid; place-items: center; padding: 6px 0 2px; border-radius: 12px; background: radial-gradient(closest-side, rgba(255, 178, 62, 0.16), transparent); }
.st-item-ico { display: block; width: 112px; height: 112px; object-fit: contain; }
.st-item.mine { border-color: rgba(123, 224, 160, 0.35); }
.st-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.st-item h3 { margin: 0; font-size: 17px; }
.st-price { color: var(--gold); font-weight: 800; white-space: nowrap; }
.st-item p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.st-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.st-item-act { margin-top: 4px; }
.st-table { width: 100%; border-collapse: collapse; margin: 8px 0 10px; font-size: 15px; }
.st-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-table td.num { text-align: right; color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }
/* The boards (slice 3): a season or all-time table that scrolls on its own on a phone, and the fighter's badges. */
.st-board-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.st-board { min-width: 520px; }
.st-board th { padding: 6px 8px 6px 0; text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--line); }
.st-board th.num { text-align: right; }
.st-board td { padding-right: 8px; }
.st-board td small { color: var(--dim); }
.st-badges { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.st-badge { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.st-badge.place-1 { border-color: var(--gold); }
.st-badge b { color: var(--gold); }
.st-badge small { color: var(--dim); }

/* Milestone frames (slice 4): rings round the fighter's card, earned only. */
.st-card.frame-sprout { box-shadow: 0 0 0 2px #8fd18a, 0 0 22px rgba(143, 209, 138, 0.25); }
.st-card.frame-harvest { box-shadow: 0 0 0 2px #e0a23a, 0 0 0 5px rgba(224, 162, 58, 0.35), 0 0 26px rgba(224, 162, 58, 0.25); }
.st-card.frame-golden { box-shadow: 0 0 0 2px #ffe08a, 0 0 0 5px #c8922a, 0 0 0 7px rgba(255, 224, 138, 0.45), 0 0 34px rgba(255, 200, 80, 0.4); }
.st-card.frame-phoenix { box-shadow: 0 0 0 2px #fff1c2, 0 0 0 5px #ff6a1a, 0 0 0 8px rgba(214, 40, 40, 0.55), 0 0 40px rgba(255, 106, 26, 0.5); }
.st-frame-tag { position: absolute; left: 8px; top: 8px; padding: 4px 9px; border-radius: 999px; background: rgba(11, 6, 8, 0.82); color: var(--gold); font: 700 12px/1.2 var(--sans); letter-spacing: 0.04em; }
.st-frames { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.st-frame { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.st-frame-swatch { width: 24px; height: 24px; border-radius: 6px; background: rgba(0, 0, 0, 0.4); opacity: 0.45; }
.st-frame.earned .st-frame-swatch { opacity: 1; }
.st-frame.frame-sprout .st-frame-swatch { box-shadow: inset 0 0 0 3px #8fd18a; }
.st-frame.frame-harvest .st-frame-swatch { box-shadow: inset 0 0 0 3px #e0a23a; }
.st-frame.frame-golden .st-frame-swatch { box-shadow: inset 0 0 0 2px #ffe08a, inset 0 0 0 5px #c8922a; }
.st-frame.frame-phoenix .st-frame-swatch { box-shadow: inset 0 0 0 2px #fff1c2, inset 0 0 0 5px #ff6a1a; }
.st-frame-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-frame-what small { color: var(--muted); }
.st-frame-bar { width: 72px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.st-frame-bar i { display: block; height: 100%; background: var(--gold); }

/* The five eras (slice 4): each one's painted banner over its story and special rule. */
.st-eras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.st-era { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.st-era-art { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.st-era-body { padding: 14px 16px 16px; }
.st-era-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.st-era h2 { margin: 0; font: 700 22px/1.2 var(--display); letter-spacing: 0.03em; }
.st-era-story { margin: 6px 0 2px; color: var(--text); }
.st-era .st-ability { margin: 10px 0 0; }

/* The sixteen. */
.st-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.st-cards .st-card { margin: 0; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); }
.st-signin { max-width: 620px; }
.st-signin p { color: var(--muted); }

@media (max-width: 980px) {
  .st-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .st-yours { grid-template-columns: minmax(0, 1fr); }
  /* One column: the two columns open up so the card, Seeds and what it carries come first. */
  .st-main-col, .st-side-col { display: contents; }
  .st .st-yours .panel, .st .st-yours .st-card { margin: 0; }
  .st-yours .st-card { order: 1; }
  .st-yours .st-seeds { order: 2; }
  .st-yours .st-carry { order: 3; }
  .st-yours .st-inv-panel { order: 4; }
  .st-yours .st-badges-panel { order: 5; }
  .st-yours .st-frames-panel { order: 6; }
  .st-yours .st-links { order: 7; }
  .st-cards { grid-template-columns: minmax(0, 1fr); }
  .st-eras { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .st { padding-top: calc(84px + env(safe-area-inset-top, 0px)); }
  .st-grid { gap: 6px; }
  .st-pick { font-size: 10px; letter-spacing: -0.02em; }
  .st-card, .st-cards .st-card { grid-template-columns: minmax(0, 1fr); }
  .st-card-art { max-width: 260px; margin: 0 auto; width: 100%; }
  .st-purse { text-align: left; }
  .st-inv { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .st-pick .st-thumb { transition: none; }
  .st-pick:hover .st-thumb { transform: none; }
}

/* Shown on other sites: the sites of ours showing this fighter (oauth.js links), each with Unlink. */
.st-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.st-link span { display: grid; gap: 2px; min-width: 0; }
.st-link b { color: var(--text); overflow-wrap: anywhere; }
.st-link small { color: var(--dim); overflow-wrap: anywhere; }
