/* The builds page. The design system comes first, generated from project/; the page's own rules follow.
   Every colour is a design-system token. Motion is 160ms for taps, 240ms for sheets, cubic-bezier(.2,.8,.2,1). */

/* The display face, Epilogue at its one weight: a self-hosted Latin subset from scripts/subset_mini_app_fonts.py,
   OFL beside it. Everything else is the system sans, which ships no file. */
@font-face { font-family: "Epilogue"; font-weight: 600; font-display: swap; src: url("fonts/epilogue.woff2") format("woff2"); }

/* >>> generated by scripts/generate_builds_styles.py from project/ — do not hand-edit */
/* Privyazka — generated from tokens.json */
:root, [data-theme="sumi"] {
  --ground: #181b26;
  --surface-1: #192236;
  --surface-2: #1b294b;
  --surface-select: #1f4788;
  --scrim: #0c0e16b8;
  --hairline: #344d56;
  --control-border: #6a7f7a;
  --text-1: #ebf6f7;
  --text-2: #c6c2b6;
  --text-3: #86aba5;
  --text-on-image: #ebf6f7;
  --image-shade: #181b26e6;
  --ally-on-image: #48929b;
  --enemy-on-image: #fa7b62;
  --icon-tile: #1b294b;
  --gold: #ffa400;
  --gold-press: #ffb95a;
  --text-on-gold: #181b26;
  --gold-text: #ffa400;
  --changed: #ff3500;
  --stamp: #bc2d29;
  --text-on-stamp: #ebf6f7;
  --ally: #48929b;
  --enemy: #fa7b62;
  --positive: #a5ba93;
  --focus: #ffa400;
  --select-ring: #ffa400;
  --shadow-raise: 0 6px 18px rgba(8,10,16,0.45);
  --shadow-sheet: 0 -12px 32px rgba(8,10,16,0.55);
}
[data-theme="washi"] {
  --ground: #ebf6f7;
  --surface-1: #f5fbfb;
  --surface-2: #dfebed;
  --surface-select: #d5e4ec;
  --scrim: #181b2666;
  --hairline: #c6c2b6;
  --control-border: #6a7f7a;
  --text-1: #181b26;
  --text-2: #344d56;
  --text-3: #4d646c;
  --text-on-image: #ebf6f7;
  --image-shade: #181b26e6;
  --ally-on-image: #48929b;
  --enemy-on-image: #fa7b62;
  --icon-tile: #1b294b;
  --gold: #ffa400;
  --gold-press: #e08a1e;
  --text-on-gold: #181b26;
  --gold-text: #985629;
  --changed: #bc2d29;
  --stamp: #bc2d29;
  --text-on-stamp: #ebf6f7;
  --ally: #1d697c;
  --enemy: #c3272b;
  --positive: #3d5d42;
  --focus: #1f4788;
  --select-ring: #1f4788;
  --shadow-raise: 0 4px 14px rgba(24,27,38,0.14);
  --shadow-sheet: 0 -8px 24px rgba(24,27,38,0.16);
}
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --size-touch: 44px;
  --size-item-w: 66px;
  --size-item-h: 48px;
  --size-ability: 36px;
  --size-medal: 48px;
  --size-medal-sm: 24px;
  --size-avatar: 32px;
  --font-display: "Epilogue", "Helvetica Neue", Helvetica, Arial, Roboto, sans-serif;
  --font-sans: "Helvetica Neue", Helvetica, Arial, Roboto, sans-serif;
}
.display-xl { font-family: var(--font-display); font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -0.01em; }
.display-l { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 600; }
.numeral { font-family: var(--font-display); font-size: 22px; line-height: 26px; font-weight: 600; }
.title { font-family: var(--font-sans); font-size: 17px; line-height: 24px; font-weight: 700; }
.body { font-family: var(--font-sans); font-size: 15px; line-height: 22px; font-weight: 500; }
.body-strong { font-family: var(--font-sans); font-size: 15px; line-height: 22px; font-weight: 700; }
.caption { font-family: var(--font-sans); font-size: 13px; line-height: 18px; font-weight: 500; }
.micro { font-family: var(--font-sans); font-size: 11px; line-height: 14px; font-weight: 700; }

/* Privyazka components. Plain CSS classes prefixed pv-, loaded after tokens.css. */
body { margin: 0; background: var(--ground); color: var(--text-1); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
.pv-demo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); padding: var(--space-4); }
.pv-demo--col { flex-direction: column; flex-wrap: nowrap; align-items: stretch; box-sizing: border-box; max-width: 422px; }
.pv-num { font-variant-numeric: tabular-nums; }

/* A link dressed as a component keeps the component's colours, never the browser's link colours */
a[class^="pv-"], a[class*=" pv-"] { text-decoration: none; }
a.pv-btn--primary:link, a.pv-btn--primary:visited { color: var(--text-on-gold); }
a.pv-btn--secondary:link, a.pv-btn--secondary:visited, a.pv-rankchip:link, a.pv-rankchip:visited, a.pv-item:link, a.pv-item:visited { color: var(--text-1); }
a.pv-btn--ghost:link, a.pv-btn--ghost:visited, a.pv-step:link, a.pv-step:visited, a.pv-hero:link, a.pv-hero:visited { color: var(--text-2); }
a.pv-step[aria-current]:link, a.pv-step[aria-current]:visited, a.pv-hero[aria-pressed="true"]:link, a.pv-hero[aria-pressed="true"]:visited { color: var(--text-1); }
a.pv-slot:link, a.pv-slot:visited { color: var(--text-on-image); }

/* Text roles */
.pv-screen-title { margin: 0; font: 600 28px/34px var(--font-display); color: var(--text-1); }
.pv-section-title { margin: 0; font: 700 17px/24px var(--font-sans); color: var(--text-1); }
.pv-lede { margin: 0; font: 500 15px/22px var(--font-sans); color: var(--text-2); }
.pv-caption { margin: 0; font: 500 13px/18px var(--font-sans); color: var(--text-3); }

/* Button */
.pv-btn { appearance: none; border: 0; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--size-touch); padding: 0 var(--space-5); border-radius: var(--radius-md); font: 700 15px/1 var(--font-sans); white-space: nowrap; cursor: pointer; transition: background-color .16s cubic-bezier(.2, .8, .2, 1); }
.pv-btn svg { width: 20px; height: 20px; flex: none; }
.pv-btn--primary { background: var(--gold); color: var(--text-on-gold); }
.pv-btn--primary:active { background: var(--gold-press); }
.pv-btn--secondary { background: var(--surface-2); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--control-border); }
.pv-btn--ghost { background: transparent; color: var(--text-2); }
.pv-btn--icon { width: var(--size-touch); padding: 0; }
.pv-btn--block { display: flex; width: 100%; }
.pv-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pv-btn:focus-visible, .pv-step:focus-visible, .pv-chip:focus-visible, .pv-rank:focus-visible, .pv-slot:focus-visible, .pv-hero:focus-visible, .pv-item:focus-visible, .pv-talent__opt:focus-visible, .pv-rankchip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Telegram bottom bar: the native MainButton and SecondaryButton, styled through setParams */
.pv-bottombar { box-sizing: border-box; display: grid; gap: var(--space-2); padding: var(--space-2) var(--space-4) var(--space-4); background: var(--ground); }
.pv-bottombar--split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.pv-mainbutton { min-height: 50px; border-radius: var(--radius-md); font-size: 16px; }

/* App bar */
.pv-appbar { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 var(--space-4); }
.pv-logo { display: block; flex: none; width: 32px; height: 32px; }
.pv-wordmark { font: 600 21px/1 var(--font-display); color: var(--text-1); letter-spacing: .01em; }
.pv-rankchip { appearance: none; border: 0; box-sizing: border-box; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: var(--size-touch); padding: 0 var(--space-3) 0 6px; border-radius: var(--radius-pill); background: var(--surface-1); color: var(--text-1); font: 700 14px/1 var(--font-sans); box-shadow: inset 0 0 0 1px var(--hairline); cursor: pointer; }
.pv-rankchip img { display: block; flex: none; width: 30px; height: 30px; }

/* Step tabs: Rank, Draft, Build */
.pv-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--hairline); }
.pv-step { appearance: none; border: 0; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--size-touch); border-radius: 12px; background: transparent; color: var(--text-2); font: 700 14px/1 var(--font-sans); cursor: pointer; }
.pv-step svg { width: 16px; height: 16px; color: var(--positive); }
.pv-step[aria-current="step"], .pv-step[aria-current="page"] { background: var(--surface-2); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--control-border); }

/* Rank medal: Valve's official medals */
.pv-medal { display: block; flex: none; width: var(--size-medal); height: var(--size-medal); object-fit: contain; }
.pv-medal--sm { width: var(--size-medal-sm); height: var(--size-medal-sm); }
.pv-medalstack { position: relative; display: block; flex: none; width: var(--size-medal); height: var(--size-medal); }
.pv-medalstack img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pv-ranks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.pv-rank { appearance: none; border: 0; box-sizing: border-box; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-2); min-height: 72px; padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2); border-radius: var(--radius-lg); background: var(--surface-1); color: var(--text-1); text-align: left; box-shadow: inset 0 0 0 1px var(--hairline); cursor: pointer; }
.pv-rank__name { display: block; font: 700 15px/20px var(--font-sans); }
.pv-rank__mmr { display: block; font: 500 12px/16px var(--font-sans); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-rank__check { position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; color: var(--select-ring); visibility: hidden; }
.pv-rank[aria-pressed="true"] { background: var(--surface-select); box-shadow: inset 0 0 0 2px var(--select-ring); }
.pv-rank[aria-pressed="true"] .pv-rank__mmr { color: var(--text-2); }
.pv-rank[aria-pressed="true"] .pv-rank__check { visibility: visible; }

/* Position number: pos 1 to pos 5 */
.pv-pos { --pos-c: var(--text-2); box-sizing: border-box; display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--pos-c); color: var(--text-1); font: 800 13px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.pv-pos--ally { --pos-c: var(--ally); }
.pv-pos--enemy { --pos-c: var(--enemy); }
.pv-pos--solid { background: var(--pos-c); color: var(--ground); box-shadow: none; }
.pv-pos--sm { width: 20px; height: 20px; border-radius: 5px; font-size: 11px; }
.pv-slot__meta .pv-pos:not(.pv-pos--solid) { color: var(--text-on-image); }
.pv-slot__meta .pv-pos--ally:not(.pv-pos--solid) { --pos-c: var(--ally-on-image); }
.pv-slot__meta .pv-pos--enemy:not(.pv-pos--solid) { --pos-c: var(--enemy-on-image); }
.pv-posrow { display: inline-flex; align-items: center; gap: var(--space-2); font: 700 13px/1 var(--font-sans); color: var(--text-2); }

/* Draft board slot */
.pv-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); }
.pv-board__team { margin: 0 0 2px; font: 700 13px/18px var(--font-sans); }
.pv-board__team--ally { color: var(--ally); }
.pv-board__team--enemy { color: var(--enemy); }
.pv-slot { appearance: none; border: 0; box-sizing: border-box; position: relative; display: block; width: 100%; height: 76px; padding: 0; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-1); color: var(--text-on-image); text-align: left; cursor: pointer; }
.pv-slot__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.pv-slot__shade { position: absolute; inset: 0; background: linear-gradient(0deg, var(--image-shade) 0%, rgba(24, 27, 38, .35) 58%, rgba(24, 27, 38, 0) 100%); }
.pv-slot__meta { position: absolute; left: 8px; right: 8px; bottom: 7px; display: flex; align-items: center; gap: 6px; }
.pv-slot__name { min-width: 0; font: 700 13px/16px var(--font-sans); color: var(--text-on-image); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-slot__you { position: absolute; top: 6px; right: 6px; padding: 3px 7px; border-radius: 5px; background: var(--gold); color: var(--text-on-gold); font: 800 11px/14px var(--font-sans); }
.pv-slot--you::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--select-ring); pointer-events: none; }
.pv-slot--empty { background: transparent; border: 1.5px dashed var(--control-border); }
.pv-slot--next { border: 2px solid var(--select-ring); background: var(--surface-1); }
.pv-slot__add { display: flex; align-items: center; gap: var(--space-2); height: 100%; padding: 0 10px; color: var(--text-2); font: 700 13px/16px var(--font-sans); }
.pv-slot__add small { display: block; font: 500 12px/16px var(--font-sans); color: var(--text-3); }
.pv-slot--next .pv-slot__add { color: var(--text-1); }
.pv-slot__plus { width: 20px; height: 20px; flex: none; margin-left: auto; color: var(--text-2); }

/* Draft meter */
.pv-meter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2); }
.pv-meter__team { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.pv-meter__pip { height: 6px; border-radius: var(--radius-pill); background: var(--hairline); }
.pv-meter__pip--ally { background: var(--ally); }
.pv-meter__pip--enemy { background: var(--enemy); }

/* Hero picker */
.pv-search { box-sizing: border-box; display: flex; align-items: center; gap: var(--space-2); min-height: var(--size-touch); padding: 0 var(--space-3); border-radius: var(--radius-md); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--control-border); color: var(--text-3); }
.pv-search svg { width: 20px; height: 20px; flex: none; }
.pv-search input { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; color: var(--text-1); font: 500 16px/22px var(--font-sans); outline: none; }
.pv-search input::placeholder { color: var(--text-3); }
.pv-search:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
.pv-chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding: 4px 0; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.pv-chips::-webkit-scrollbar { display: none; }
.pv-chip { appearance: none; border: 0; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-width: var(--size-touch); min-height: var(--size-touch); padding: 0 var(--space-3); border-radius: var(--radius-pill); background: var(--surface-1); color: var(--text-2); font: 700 13px/1 var(--font-sans); box-shadow: inset 0 0 0 1px var(--hairline); cursor: pointer; }
.pv-chip::after { content: ""; position: absolute; inset: -4px 0; }
.pv-chip img { width: 18px; height: 18px; }
.pv-chip[aria-pressed="true"] { background: var(--surface-select); color: var(--text-1); box-shadow: inset 0 0 0 1.5px var(--text-2); }
.pv-heroes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-2); }
.pv-hero { appearance: none; border: 0; padding: 0; background: none; display: grid; align-content: start; gap: 6px; min-width: 0; color: var(--text-2); text-align: left; cursor: pointer; }
.pv-hero__img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-1); }
.pv-hero__name { font: 700 12px/16px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-hero__note { display: block; font: 500 11px/14px var(--font-sans); color: var(--text-3); }
.pv-hero[aria-pressed="true"] .pv-hero__img { outline: 2px solid var(--select-ring); outline-offset: 2px; }
.pv-hero[aria-pressed="true"] .pv-hero__name { color: var(--text-1); }
.pv-hero[aria-disabled="true"] { cursor: not-allowed; }
.pv-hero[aria-disabled="true"] .pv-hero__img { filter: grayscale(1); opacity: .4; }

/* Bottom sheet */
.pv-scrim { position: absolute; inset: 0; background: var(--scrim); }
.pv-sheet { box-sizing: border-box; position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: var(--space-4); padding: var(--space-2) var(--space-4) var(--space-6); border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--surface-2); box-shadow: var(--shadow-sheet); }
.pv-sheet__handle { justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--control-border); }
.pv-sheet__head { display: flex; align-items: center; gap: var(--space-3); }
.pv-sheet__title { margin: 0; font: 700 17px/24px var(--font-sans); color: var(--text-1); }
.pv-sheet__head .pv-btn--icon { margin-left: auto; }

/* Build header */
.pv-herohead { position: relative; overflow: hidden; isolation: isolate; min-height: 212px; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-1); }
.pv-herohead__waves { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.pv-herohead__render { position: absolute; right: -36px; bottom: -64px; z-index: -1; width: 236px; height: auto; }
.pv-herohead__name { margin: 0; font: 600 40px/44px var(--font-display); letter-spacing: -.01em; color: var(--text-1); }
.pv-herohead__meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); max-width: 230px; }
.pv-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px 0 4px; border-radius: var(--radius-pill); background: var(--ground); color: var(--text-1); font: 700 12px/1 var(--font-sans); box-shadow: inset 0 0 0 1px var(--hairline); }
.pv-tag img { display: block; width: 24px; height: 24px; margin: -2px 0; }
.pv-tag--plain { padding-left: 10px; }
.pv-stat { margin-top: var(--space-4); display: grid; gap: 2px; max-width: 200px; }
.pv-stat__value { font: 600 22px/26px var(--font-display); color: var(--text-1); font-variant-numeric: tabular-nums; }
.pv-stat__label { font: 500 12px/16px var(--font-sans); color: var(--text-3); }

/* Threat row: what in this draft changed the build */
.pv-threat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--surface-1); }
.pv-threat__faces { display: flex; padding-left: 4px; }
.pv-threat__faces img { width: var(--size-avatar); height: var(--size-avatar); border-radius: 50%; object-fit: cover; object-position: 50% 22%; box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 3.5px var(--enemy); }
.pv-threat__faces img + img { margin-left: -6px; }
.pv-threat__what { display: block; font: 700 14px/18px var(--font-sans); color: var(--text-1); }
.pv-threat__why { display: block; font: 500 13px/18px var(--font-sans); color: var(--text-3); }
.pv-threat__answer { display: block; width: 44px; height: 32px; border-radius: var(--radius-xs); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }

/* Item tile */
.pv-item { appearance: none; border: 0; position: relative; display: grid; justify-items: center; gap: 4px; width: var(--size-item-w); padding: 0; background: none; color: var(--text-1); cursor: pointer; }
.pv-item__icon { display: block; width: var(--size-item-w); height: var(--size-item-h); border-radius: var(--radius-xs); object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.pv-item__cost { font: 700 12px/14px var(--font-sans); color: var(--gold-text); font-variant-numeric: tabular-nums; }
.pv-item__time { font: 500 11px/14px var(--font-sans); color: var(--text-3); font-variant-numeric: tabular-nums; }
.pv-item__count { position: absolute; top: 31px; right: 3px; padding: 0 3px; border-radius: 3px; background: var(--image-shade); color: var(--text-on-image); font: 800 11px/14px var(--font-sans); }
.pv-item--sm { width: 44px; }
.pv-item--sm .pv-item__icon { width: 44px; height: 32px; }
.pv-item--adjusted .pv-item__icon { box-shadow: 0 0 0 2px var(--changed); }
.pv-item__mark { position: absolute; top: -7px; right: -7px; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--stamp); color: var(--text-on-stamp); box-shadow: 0 0 0 2px var(--surface-1); }
.pv-item__mark svg { width: 12px; height: 12px; }
.pv-item--bought .pv-item__icon { opacity: .4; }
.pv-stamp { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 5px; border-radius: 6px; background: var(--stamp); color: var(--text-on-stamp); font: 700 12px/16px var(--font-sans); }
.pv-stamp svg { width: 14px; height: 14px; flex: none; }
.pv-gold { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.pv-gold img { display: block; width: 18px; height: 18px; }

/* Item phase */
.pv-phase { display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-1); }
.pv-phase__head { display: flex; align-items: center; gap: var(--space-2); }
.pv-phase__title { margin: 0; font: 700 17px/24px var(--font-sans); color: var(--text-1); }
.pv-phase__when { font: 500 13px/18px var(--font-sans); color: var(--text-3); }
.pv-phase__total { margin-left: auto; font: 700 13px/18px var(--font-sans); color: var(--gold-text); }
.pv-phase__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); }
.pv-phase__then { align-self: center; margin-top: -20px; width: 14px; height: 14px; color: var(--text-3); }
.pv-phase__note { margin: 0; font: 500 13px/18px var(--font-sans); color: var(--text-2); }
.pv-answer { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-3); }
.pv-answer + .pv-answer { padding-top: var(--space-3); border-top: 1px solid var(--hairline); }
.pv-answer__why { display: grid; gap: 2px; }
.pv-answer__name { font: 700 15px/20px var(--font-sans); color: var(--text-1); }
.pv-answer__vs { display: flex; align-items: center; gap: 6px; font: 500 13px/18px var(--font-sans); color: var(--text-3); }
.pv-answer__vs img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; box-shadow: 0 0 0 1.5px var(--enemy); }
.pv-answer__vs img + img { margin-left: -8px; }

/* Skill order */
.pv-skills { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: var(--space-3) 4px; }
.pv-skill { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.pv-skill__lvl { font: 700 11px/14px var(--font-sans); color: var(--text-3); font-variant-numeric: tabular-nums; }
.pv-skill__icon { position: relative; display: grid; place-items: center; width: 100%; max-width: var(--size-ability); aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.pv-skill__icon img { display: block; width: 100%; height: 100%; }
.pv-skill__key { position: absolute; right: 0; bottom: 0; min-width: 13px; padding: 0 3px; border-top-left-radius: 4px; background: var(--image-shade); color: var(--text-on-image); font: 800 10px/13px var(--font-sans); text-align: center; }
.pv-skill--ult .pv-skill__icon::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--select-ring); pointer-events: none; }
.pv-skill--talent .pv-skill__icon, .pv-skill--stat .pv-skill__icon { background: var(--icon-tile); color: var(--text-on-image); }
.pv-skill--talent .pv-skill__icon img { width: 64%; height: auto; }
.pv-skill--stat .pv-skill__icon { font: 800 12px/1 var(--font-sans); }
.pv-ability { display: grid; grid-template-columns: var(--size-ability) minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.pv-ability > img { width: var(--size-ability); height: var(--size-ability); border-radius: var(--radius-sm); }
.pv-ability__tile { display: grid; place-items: center; width: var(--size-ability); height: var(--size-ability); border-radius: var(--radius-sm); background: var(--icon-tile); }
.pv-ability__tile img { width: 72%; height: 72%; }
.pv-ability__name { display: block; font: 700 14px/18px var(--font-sans); color: var(--text-1); }
.pv-ability__note { display: block; font: 500 12px/16px var(--font-sans); color: var(--text-3); }
.pv-ability__order { padding: 4px 8px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); font: 700 12px/16px var(--font-sans); white-space: nowrap; }

/* Talent tree */
.pv-talents { display: grid; gap: var(--space-2); }
.pv-talent { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: var(--space-2); }
.pv-talent__lvl { display: grid; place-items: center; font: 600 20px/1 var(--font-display); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pv-talent__opt { appearance: none; border: 0; display: grid; align-content: center; gap: 2px; min-height: 56px; padding: var(--space-2) 10px; border-radius: var(--radius-md); background: var(--surface-1); color: var(--text-2); font: 500 13px/17px var(--font-sans); text-align: left; cursor: pointer; }
.pv-talent__rate { font: 700 11px/14px var(--font-sans); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pv-talent__opt[aria-pressed="true"] { background: var(--surface-select); color: var(--text-1); box-shadow: inset 0 0 0 1.5px var(--select-ring); }
.pv-titlerow { display: flex; align-items: center; gap: var(--space-2); }
.pv-titlerow img { display: block; width: 22px; height: 22px; padding: 4px; border-radius: var(--radius-sm); background: var(--icon-tile); }

@media (prefers-reduced-motion: reduce) { .pv-btn { transition: none; } }

/* Item swap: another pick for one build slot */
.pv-item--picked .pv-item__icon { box-shadow: 0 0 0 2px var(--select-ring); }
.pv-item__mark--picked { background: var(--select-ring); color: var(--ground); }
.pv-sheet__icon { display: block; flex: none; width: var(--size-item-w); height: var(--size-item-h); border-radius: var(--radius-xs); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.pv-sheet__cost { display: block; margin-top: 2px; font: 700 15px/20px var(--font-sans); color: var(--gold-text); }
.pv-options { display: grid; gap: var(--space-2); }
.pv-option { appearance: none; border: 0; box-sizing: border-box; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); width: 100%; min-height: 64px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-1); color: var(--text-1); text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--hairline); }
.pv-option[aria-checked="true"] { background: var(--surface-select); box-shadow: inset 0 0 0 1.5px var(--select-ring); }
.pv-option:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pv-option__icon { display: block; width: 44px; height: 32px; border-radius: var(--radius-xs); object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.pv-option__text { display: grid; gap: 2px; min-width: 0; }
.pv-option__name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font: 700 14px/18px var(--font-sans); color: var(--text-1); }
.pv-option__tag { padding: 1px 6px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); font: 700 11px/14px var(--font-sans); }
.pv-option__why { font: 500 12px/16px var(--font-sans); color: var(--text-2); }
.pv-option__meta { display: grid; justify-items: end; gap: 2px; font: 700 12px/16px var(--font-sans); color: var(--text-1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-option__meta .pv-gold img { width: 16px; height: 16px; }
.pv-option__rate { font-weight: 500; color: var(--text-2); }
.pv-caution { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; padding: 10px var(--space-3); border-radius: var(--radius-md); background: var(--surface-1); color: var(--text-1); font: 500 13px/18px var(--font-sans); box-shadow: inset 0 0 0 1px var(--changed); }
.pv-caution svg { flex: none; width: 18px; height: 18px; color: var(--changed); }
.pv-picknote { display: flex; align-items: center; gap: var(--space-2); margin: 0; font: 500 13px/18px var(--font-sans); color: var(--text-2); }
.pv-picknote svg { flex: none; width: 16px; height: 16px; color: var(--text-2); }
.pv-picknote .pv-btn { margin-left: auto; padding: 0 var(--space-3); color: var(--text-1); }
/* <<< end generated design system */

/* ── The page ─────────────────────────────────────────────────────────── */

:root {
  --ms-tap: 160ms;
  --ms-sheet: 240ms;
  --ms-fade: 120ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --column: 600px;
  --bar-height: 0px;
  /* What the keyboard covers while the picker's search field has focus (src/sheet.js). The lift is 0,
     and the room and the resting box fall back to the whole box, the rest of the time. */
  --kb: 0px;
  color-scheme: dark;
}
[data-theme="washi"] { color-scheme: light; }

[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; background: var(--ground); color: var(--text-1); }
body { min-height: var(--app-h, 100vh); overscroll-behavior: none; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.book {
  box-sizing: border-box;
  display: grid;
  gap: var(--space-4);
  align-content: start;
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: calc(var(--tg-content-safe-area-inset-top, 0px)) max(var(--space-4), env(safe-area-inset-right)) calc(var(--space-8) + var(--bar-height) + env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
}
.book > .pv-appbar { padding: 0; }
.book > .pv-steps { position: sticky; top: 0; z-index: 5; }

.view { display: grid; gap: var(--space-6); align-content: start; outline: none; }
.view:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

/* A chip that is a radio carries aria-checked; it looks like a pressed chip. */
.pv-chip[role="radio"][aria-checked="true"] { background: var(--surface-select); color: var(--text-1); box-shadow: inset 0 0 0 1.5px var(--text-2); }
.pv-chip[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* A picture the CDN does not have leaves its frame empty. */
img.is-broken { visibility: hidden; }

/* Rank */
.settings, .setting, .you-play { display: grid; gap: var(--space-2); }
.settings { gap: var(--space-4); }
.setting__label { color: var(--text-2); }
.about-link { justify-self: center; }
.pv-rank > span { min-width: 0; }
.pv-rank__mmr { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 359px) {
  .pv-ranks { gap: var(--space-2); }
  .pv-rank { padding-right: var(--space-2); }
  .pv-rank .pv-medal { width: 36px; height: 36px; }
}

/* Draft */
.you-play .pv-chip { min-width: var(--size-touch); }
.pv-slot { min-height: var(--size-touch); -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#draft-clear { justify-self: start; }

/* One fold, wherever it sits: a head that says what it holds, and a body. The chevron turns down when
   it is open. Only the fold that just opened plays its opening. */
.fold__head { appearance: none; border: 0; box-sizing: border-box; display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--size-touch); margin: 0; padding: 0; background: none; color: var(--text-1); font: inherit; text-align: left; cursor: pointer; }
.fold__text { display: grid; gap: 2px; min-width: 0; }
.fold__chev { flex: none; width: 18px; height: 18px; margin-left: auto; color: var(--text-3); transition: transform var(--ms-tap) var(--ease); }
[aria-expanded="true"] > .fold__chev { transform: rotate(90deg); }
.fold__body.is-opening { animation: fold-in var(--ms-tap) var(--ease); }
@keyframes fold-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.fold__head:focus-visible, .herocard__rate:focus-visible, .finalbuild__item:focus-visible, .enemychip:focus-visible,
.path__item:focus-visible, .path__fork:focus-visible, .stage__link:focus-visible, .fork__option:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Rank: the settings fold under their values. */
.settings__heading { margin: 0; }
.settings .fold__head { min-height: 56px; }
.settings__body { display: grid; gap: var(--space-4); }

/* Build */
.build { display: grid; gap: var(--space-4); }
.threats, .threats__rows, .phases { display: grid; gap: var(--space-3); }
.threats__rows { gap: var(--space-2); }
button.pv-threat { appearance: none; border: 0; box-sizing: border-box; width: 100%; margin: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.pv-threat:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.build[aria-busy="true"] .phases, .build[aria-busy="true"] .pv-stat__value { opacity: .55; transition: opacity var(--ms-tap) var(--ease); }
div.pv-item { cursor: default; }
div.pv-talent__opt { cursor: default; }
.pv-talent__opt.is-picked { background: var(--surface-select); color: var(--text-1); box-shadow: inset 0 0 0 1.5px var(--select-ring); }
.pv-talents > .pv-stamp { margin-left: calc(40px + var(--space-2)); }
.build-skills { display: grid; gap: var(--space-4); }
.talents-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--icon-tile); }
.talents-icon img { width: 18px; height: 18px; }
.pv-item.is-flash { outline: 2px solid var(--select-ring); outline-offset: 2px; }

/* The hero card: who, the win rate, and the final build. The win rate's basis folds under it. */
.herocard { min-height: 0; display: grid; gap: var(--space-3); padding: var(--space-3) var(--space-4) var(--space-4); }
.herocard__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.herocard__face { display: block; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; background: var(--surface-2); box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 3.5px var(--ally); }
.herocard__who { display: grid; gap: 6px; min-width: 0; }
.herocard__name { display: -webkit-box; margin: 0; overflow: hidden; font: 600 24px/28px var(--font-display); letter-spacing: -.01em; color: var(--text-1); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.herocard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.herocard__tags .pv-tag { min-height: 24px; }
.herocard__rate { appearance: none; border: 0; box-sizing: border-box; display: grid; justify-items: end; align-content: center; gap: 2px; max-width: 96px; min-height: var(--size-touch); margin: 0; padding: var(--space-1) 0 var(--space-1) var(--space-2); border-radius: var(--radius-md); background: none; color: var(--text-1); text-align: right; cursor: pointer; }
.herocard__label { font: 500 12px/16px var(--font-sans); color: var(--text-3); }
.herocard__info { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.herocard__rate[aria-expanded="true"] .herocard__info { color: var(--text-1); }
.herocard .basis { margin: 0; }
.finalbuild { display: grid; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--hairline); }
.finalbuild__items { display: grid; grid-template-columns: repeat(6, minmax(0, 44px)); gap: var(--space-2); }
.finalbuild__item { appearance: none; border: 0; position: relative; display: grid; align-content: center; min-height: var(--size-touch); margin: 0; padding: 0; background: none; cursor: pointer; }
.finalbuild__icon { display: block; width: 100%; aspect-ratio: 44 / 32; border-radius: var(--radius-xs); }
.finalbuild__item .pv-item__count { top: auto; bottom: 8px; }
.finalbuild__item.is-bought .finalbuild__icon { opacity: .4; }

/* The insights: the draft's threats and enemies, folded to one line. */
.insights { gap: 0; padding: 0 var(--space-4); }
.insights__head { min-height: 56px; font: 700 14px/18px var(--font-sans); }
.insights__mark { display: inline-grid; flex: none; color: var(--changed); }
.insights__mark svg { width: 18px; height: 18px; }
.insights__sum { min-width: 0; }
.insights__body { display: grid; gap: var(--space-5); padding-bottom: var(--space-4); }
.insights__title { margin: 0 0 var(--space-2); font: 700 13px/18px var(--font-sans); color: var(--text-2); }
.insights .pv-threat { background: var(--surface-2); }
.insights .pv-threat__faces img { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3.5px var(--enemy); }
.enemies { display: grid; gap: var(--space-2); }
.enemystrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.enemychip { appearance: none; border: 0; display: grid; justify-items: center; gap: 6px; min-width: 0; min-height: var(--size-touch); margin: 0; padding: var(--space-1) 0; border-radius: var(--radius-md); background: none; color: var(--text-2); cursor: pointer; }
.enemychip__frame { position: relative; display: block; width: 44px; height: 44px; }
.enemychip__face { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 3.5px var(--enemy); }
.enemychip__pos { position: absolute; right: -6px; bottom: -4px; background: var(--surface-1); }
.enemychip__name { max-width: 100%; font: 700 11px/14px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The stages fold to one line: the stage, its minutes and gold, and its purchases small. */
.path-key { margin-bottom: calc(-1 * var(--space-1)); }
.stage { gap: 0; padding: 0 var(--space-4); }
.stage__heading { margin: 0; }
.stage__head { flex-wrap: wrap; row-gap: var(--space-2); min-height: 56px; padding: var(--space-3) 0; }
.stage__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--space-2); min-width: 0; }
.stage__head .pv-phase__total { margin-left: auto; }
.stage__head .pv-phase__total + .fold__chev { margin-left: 0; }
.stage__peek { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.stage__head[aria-expanded="true"] .stage__peek { display: none; }
.stage__mini { display: block; width: 33px; height: 24px; border-radius: var(--radius-xs); }
.stage__mini.is-bought { opacity: .4; }
.stage__none { font: 500 13px/18px var(--font-sans); color: var(--text-3); }
.stage__body { display: grid; gap: var(--space-3); padding-bottom: var(--space-4); }
.stage__more { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.stage__link { appearance: none; border: 0; display: inline-flex; align-items: center; gap: 2px; min-height: var(--size-touch); margin: 0; padding: 0; background: none; color: var(--text-2); font: 700 13px/18px var(--font-sans); cursor: pointer; }
.stage__link .fold__chev { margin-left: 0; width: 16px; height: 16px; }
.stage__fold, .stage__slots { display: grid; gap: var(--space-3); }

/* The path: one row per purchase, numbered in buy order, on a rail. */
.path { position: relative; display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.path::before { content: ""; position: absolute; left: 11px; top: 22px; bottom: 22px; width: 2px; border-radius: 1px; background: var(--hairline); }
.path__step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: var(--space-2); }
.path__step > :not(.path__num) { grid-column: 2; }
.path__num { position: relative; display: grid; place-items: center; grid-row: 1; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font: 700 12px/1 var(--font-sans); font-variant-numeric: tabular-nums; box-shadow: 0 0 0 3px var(--surface-1); }
.path__step--part .path__num { visibility: hidden; }
.path__line { position: relative; display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.path__item { appearance: none; border: 0; flex: 1; display: flex; align-items: center; gap: var(--space-3); min-width: 0; min-height: var(--size-touch); margin: 0; padding: 0; border-radius: var(--radius-md); background: none; color: var(--text-1); text-align: left; cursor: pointer; }
.path__iconbox { position: relative; flex: none; }
.path__icon { display: block; width: 44px; height: 32px; border-radius: var(--radius-xs); }
.path__text { display: grid; gap: 2px; min-width: 0; }
.path__name { font: 700 14px/18px var(--font-sans); color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.path__meta { font: 500 12px/16px var(--font-sans); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.path__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-2); min-width: 0; }
.path__bought { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.path__bought svg { width: 14px; height: 14px; color: var(--positive); }
.path__step--part .path__icon { opacity: .6; }
.path__step.is-bought .path__icon { opacity: .4; }
.path__step.is-bought .path__name { color: var(--text-2); }
.path__step.is-picked .path__icon { box-shadow: 0 0 0 2px var(--select-ring); }
.path__step.is-adjusted .path__icon { box-shadow: 0 0 0 2px var(--changed); }
.path__tag { flex: none; padding: 0 6px; }
.path__fork { appearance: none; border: 0; position: relative; flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; margin: 0; padding: 0 6px 0 var(--space-2); border-radius: var(--radius-pill); background: none; color: var(--text-2); font: 700 13px/1 var(--font-sans); font-variant-numeric: tabular-nums; cursor: pointer; box-shadow: inset 0 0 0 1px var(--hairline); }
.path__fork::after { content: ""; position: absolute; inset: -6px -2px; }
.path__fork svg { width: 16px; height: 16px; }
.path__fork .fold__chev { width: 14px; height: 14px; margin-left: 0; }
.path__fork[aria-expanded="true"] { background: var(--surface-2); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--control-border); }
.path__step > .pv-stamp { justify-self: start; }
/* A purchase that a re-plan changed, or that a tap pointed at, lights up once. */
.path__step.is-flash > .path__line::after { content: ""; position: absolute; inset: -4px -6px; border-radius: var(--radius-md); box-shadow: inset 0 0 0 2px var(--select-ring); pointer-events: none; animation: flash-out 1200ms var(--ease) forwards; }
@keyframes flash-out { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

/* The fork: the options a purchase did not take, each with what the build buys after it. */
.fork { display: grid; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline); }
.fork__head { display: flex; align-items: center; gap: var(--space-2); }
.fork__title { min-width: 0; font: 700 13px/18px var(--font-sans); color: var(--text-1); }
.fork__reset { margin-left: auto; padding: 0 var(--space-3); color: var(--text-1); }
.fork__note { margin: 0; font: 500 12px/16px var(--font-sans); color: var(--text-3); }
.fork__option { appearance: none; border: 0; box-sizing: border-box; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: var(--space-3); width: 100%; min-height: 60px; margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-1); color: var(--text-1); text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--hairline); }
.fork__option[aria-disabled="true"] { opacity: .55; cursor: progress; }
.fork__icon { display: block; width: 44px; height: 32px; border-radius: var(--radius-xs); }
.fork__text { display: grid; gap: 4px; min-width: 0; }
.fork__top { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
.fork__name { flex: 1; min-width: 0; font: 700 14px/18px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fork__then { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font: 500 12px/16px var(--font-sans); color: var(--text-3); }
.fork__next { display: block; width: 33px; height: 24px; border-radius: var(--radius-xs); }
.fork__pct { flex: none; font: 700 13px/18px var(--font-sans); color: var(--text-2); font-variant-numeric: tabular-nums; }

/* A stage's six slots, under its fold. A carried item keeps its cell. */
.inventory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-2); justify-items: center; align-items: start; }
.slot { width: var(--size-item-w); }
.slot--empty { box-sizing: border-box; height: var(--size-item-h); border-radius: var(--radius-xs); border: 1.5px dashed var(--control-border); }
/* A part on its way to a major: the part, and the major's small icon on its corner. */
.slot--towards .pv-item__icon { opacity: .6; }
.slot__towards { position: absolute; top: 26px; right: -8px; display: block; padding: 2px; border-radius: var(--radius-xs); background: var(--surface-1); }
.slot__towards img { display: block; width: 28px; height: 20px; border-radius: 3px; }

/* What left the slots in a stage, and what the enemies get in it. */
.stage__out { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.stage__label { font: 700 12px/16px var(--font-sans); color: var(--text-3); }
.stage__gone { display: block; width: 33px; height: 24px; border-radius: var(--radius-xs); opacity: .55; }
.theyget__items { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-2); }
.theyget__item { position: relative; display: grid; justify-items: center; gap: 2px; padding-top: 4px; }
.theyget__icon { display: block; width: 44px; height: 32px; border-radius: var(--radius-xs); }
.theyget__face { position: absolute; top: 0; left: -6px; width: 18px; height: 18px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; box-shadow: 0 0 0 1.5px var(--enemy); }
.theyget__time { font: 500 11px/14px var(--font-sans); color: var(--text-3); font-variant-numeric: tabular-nums; }

/* A threat's answer: in time, late, or none in the build yet. */
.pv-threat__status { display: block; margin-top: 2px; font: 700 12px/16px var(--font-sans); color: var(--text-2); }
.pv-threat[data-status="late"] .pv-threat__status, .pv-threat[data-status="open"] .pv-threat__status { color: var(--text-1); }
.pv-threat[data-status="open"] .pv-threat__answer { opacity: .55; }

/* The enemy sheet: one enemy's likely items by stage, and the threats it brings. */
#enemy-sheet { grid-template-rows: auto auto minmax(0, 1fr); }
.enemy__face { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3.5px var(--enemy); }
.enemy__row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: var(--space-2); }
.enemy__label { font: 700 12px/16px var(--font-sans); color: var(--text-3); }
.enemy__items { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.enemy__item { display: grid; justify-items: center; gap: 2px; }
.enemy__icon { display: block; width: 44px; height: 32px; border-radius: var(--radius-xs); }
.enemy__time { font: 500 11px/14px var(--font-sans); color: var(--text-3); font-variant-numeric: tabular-nums; }
.enemy__threat { display: grid; gap: 2px; margin: 0; padding-top: var(--space-2); border-top: 1px solid var(--hairline); font: 500 13px/18px var(--font-sans); color: var(--text-2); }
.enemy__what { font-weight: 700; color: var(--text-1); }
.enemy__threat[data-status="late"] .enemy__answer, .enemy__threat[data-status="open"] .enemy__answer { color: var(--text-1); }

/* Skills: an ability's description folds under its name. */
.abilities { display: grid; gap: var(--space-1); }
.ability { display: grid; gap: var(--space-1); }
.ability__head { box-sizing: border-box; width: 100%; min-height: var(--size-touch); margin: 0; padding: var(--space-1) 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
button.ability__head { appearance: none; grid-template-columns: var(--size-ability) minmax(0, 1fr) auto auto; cursor: pointer; }
.ability__head .fold__chev { margin-left: 0; }
.ability__key { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: var(--radius-xs); background: var(--surface-2); color: var(--text-2); font: 700 11px/16px var(--font-sans); vertical-align: 1px; }
.ability__note { margin: 0 0 var(--space-2) calc(var(--size-ability) + var(--space-3)); }

/* The build's outline while the first answer is on its way. */
.skeleton { display: grid; gap: var(--space-4); }
.skeleton__card { display: grid; gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-1); }
.skeleton__top { display: flex; align-items: center; gap: var(--space-3); }
.skeleton__face { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); }
.skeleton__lines { display: grid; flex: 1; gap: var(--space-2); }
.skeleton__bar { display: block; width: 60%; height: 14px; border-radius: var(--radius-pill); background: var(--surface-2); }
.skeleton__bar--short { width: 36%; }
.skeleton__tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 44px)); gap: var(--space-2); }
.skeleton__tiles > span { display: block; aspect-ratio: 44 / 32; border-radius: var(--radius-xs); background: var(--surface-2); }
.skeleton__row { height: 56px; border-radius: var(--radius-lg); background: var(--surface-1); }
.skeleton__row--open { height: 176px; }

/* The slim tabs: on Build, once the hero card has slid under them. */
.pv-steps.is-slim { grid-template-columns: repeat(3, auto) minmax(0, 1fr); padding: 2px; }
.pv-steps.is-slim .pv-step { position: relative; min-height: 36px; padding: 0 var(--space-3); }
.pv-steps.is-slim .pv-step::after { content: ""; position: absolute; inset: -4px 0; }
.steps__context { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); min-width: 0; padding-right: var(--space-2); font: 600 15px/1 var(--font-display); color: var(--text-1); }
.steps__face { display: block; flex: none; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; box-shadow: 0 0 0 1.5px var(--ally); }

/* The one orchestrated moment: when a build arrives, its phases fade in top to bottom, 40ms apart. */
.phases.is-arriving > .pv-phase { animation: phase-in var(--ms-sheet) var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes phase-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* About */
.about__mark { width: 96px; height: 96px; }

/* Sheets */
.pv-scrim { position: fixed; inset: 0; z-index: 40; opacity: 0; transition: opacity var(--ms-sheet) var(--ease); }
.pv-scrim.is-open { opacity: 1; }
/* A sheet on its way out lets taps through to the page. */
.pv-scrim:not(.is-open), .sheet:not(.is-open) { pointer-events: none; }
.sheet {
  position: fixed;
  left: 50%;
  /* It stands on the keyboard where the keys lie over the page (iOS); elsewhere --kb is 0. */
  bottom: var(--kb);
  z-index: 41;
  box-sizing: border-box;
  width: min(100%, var(--column));
  max-height: calc(var(--app-h, 100vh) * .88);
  display: grid;
  gap: var(--space-3);
  padding-bottom: calc(var(--space-4) + var(--bar-height) + env(safe-area-inset-bottom));
  transform: translate(-50%, 100%);
  transition: transform var(--ms-sheet) var(--ease);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet:focus { outline: none; }
.sheet .pv-sheet__head { touch-action: none; }
.sheet__scroll { overflow-y: auto; overscroll-behavior: contain; display: grid; gap: var(--space-4); align-content: start; min-height: 0; }
/* The picker keeps one height while its filter changes; the item sheet fits its rows. */
#picker { height: calc(var(--app-h, 100vh) * .88); grid-template-rows: auto auto auto auto minmax(0, 1fr); }
/* While somebody types, the picker fits what the keyboard left. --app-h holds the resting height then, and
   Android has already shrunk the page, so the resting share alone would push the sheet's head off the top. */
#picker.sheet--typing { height: min(calc(var(--kb-rest, 100%) * .88), calc(var(--kb-room, 100%) - var(--space-2))); max-height: var(--kb-room, 100%); }
#item-sheet { grid-template-rows: auto auto minmax(0, 1fr); }
.item-others { display: grid; gap: var(--space-3); }

/* The browser preview's stand-in for Telegram's bottom buttons */
.bottombar { position: fixed; left: 50%; bottom: 0; z-index: 45; width: min(100%, var(--column)); transform: translateX(-50%); padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
.bottombar.has-secondary { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.bottombar .pv-mainbutton[disabled] { opacity: .6; }

/* Toast: one line over the bottom bar, in the colour of its tone */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-6) + var(--bar-height) + env(safe-area-inset-bottom));
  z-index: 1000;
  box-sizing: border-box;
  width: min(calc(100% - 2 * var(--space-4)), calc(var(--column) - 2 * var(--space-4)));
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-1);
  font: 500 15px/22px var(--font-sans);
  box-shadow: var(--shadow-sheet);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ms-tap) var(--ease), transform var(--ms-tap) var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="error"] { box-shadow: inset 3px 0 0 var(--stamp), var(--shadow-sheet); }
.toast[data-tone="warn"] { box-shadow: inset 3px 0 0 var(--gold), var(--shadow-sheet); }

/* Splash: the cover a launch wears until the first screen is ready */
.splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; align-content: center; gap: var(--space-4); background: var(--ground); transition: opacity var(--ms-sheet) var(--ease), visibility 0s linear var(--ms-sheet); }
.splash--gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__title { margin: 0; font: 600 22px/26px var(--font-display); color: var(--text-1); }
.splash__fail { appearance: none; border: 0; display: grid; gap: var(--space-1); padding: var(--space-4); background: none; color: var(--text-2); font: 500 15px/22px var(--font-sans); text-align: center; cursor: pointer; }
.splash__said { color: var(--text-1); font-weight: 700; }

/* Telegram Desktop and tablets: Draft and Build side by side; wide screens give the items their own column. */
@media (min-width: 720px) {
  :root { --column: 1080px; }
  .book { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: var(--space-8); }
  .book > .pv-appbar, .book > .pv-steps, #view-rank, #view-about, #view-outside { grid-column: 1 / -1; }
  .book[data-step="draft"] #view-build, .book[data-step="build"] #view-draft { display: grid !important; }
  .book[data-step="draft"] #view-draft, .book[data-step="build"] #view-draft { grid-column: 1; }
  .book[data-step="draft"] #view-build, .book[data-step="build"] #view-build { grid-column: 2; }
  .sheet { width: min(100%, 600px); }
}
@media (min-width: 1080px) {
  :root { --column: 1400px; }
  .book { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, .8fr); }
  .book[data-step="draft"] #view-build, .book[data-step="build"] #view-build { grid-column: 2 / 4; }
  .build { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: var(--space-8); align-items: start; }
  .build > .herocard, .build > .insights { grid-column: 1 / -1; }
  .build-tabs { display: none; }
  .build-items, .build-skills { display: grid !important; }
  .build-items { grid-column: 1; }
  .build-skills { grid-column: 2; }
}

@media (hover: hover) {
  .pv-hero:hover:not([aria-disabled="true"]) { background: var(--surface-select); }
}

/* Reduced motion: movement becomes a 120ms fade, and nothing animates on its own. */
@media (prefers-reduced-motion: reduce) {
  .sheet { transform: translate(-50%, 0); opacity: 0; transition: opacity var(--ms-fade) linear; }
  .sheet.is-open { opacity: 1; }
  .pv-scrim, .toast, .splash { transition: opacity var(--ms-fade) linear; }
  .toast, .toast.is-on { transform: translate(-50%, 0); }
  .phases.is-arriving > .pv-phase { animation: none; }
  .fold__chev { transition: none; }
  .fold__body.is-opening { animation: fold-fade var(--ms-fade) linear; }
  .path__step.is-flash > .path__line::after { animation: flash-fade var(--ms-fade) linear 1080ms forwards; }
}
@keyframes fold-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes flash-fade { from { opacity: 1; } to { opacity: 0; } }
