/* TFT's Helper — web v2. Dark navy + gold/teal, matching the Android app.
   Mobile-first, but a real PC website at desktop widths: full-width content,
   top header navigation, multi-column layouts. */
:root{
  color-scheme: dark;
  --bg:#0a1128; --bg2:#0d1533; --card:#141b3d; --card2:#1a2347; --line:#2a3560;
  --gold:#f2b01e; --gold-dim:#c8930f; --teal:#2dd4bf; --teal-dim:#0f766e;
  --text:#eef1ff; --muted:#9aa3c7; --muted2:#6b7599;
  --cost1:#9aa3b2; --cost2:#22c55e; --cost3:#3b82f6; --cost4:#a855f7; --cost5:#f59e0b; --cost7:#ff5d8f;
  --tierS:#f2b01e; --tierA:#2dd4bf; --tierB:#60a5fa; --tierC:#9aa3b2; --tierX:#f472b6;
  --radius:16px; --nav-h:62px; --content-w:1180px;
}
*{box-sizing:border-box; margin:0; padding:0}
html{-webkit-text-size-adjust:100%}
body{background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; font-size:15px; line-height:1.45; padding-bottom:calc(var(--nav-h) + 18px); min-height:100vh; display:flex; flex-direction:column}
/* Every page's main content fills the viewport height: short pages end
   at the bottom of the screen instead of leaving a dead empty gap below
   the content (the fixed bottom nav still floats above, on phones). */
main{flex:1; display:flex; flex-direction:column; width:100%}
main>*{width:100%}
a{color:var(--teal); text-decoration:none}
img{display:block; max-width:100%}
button{font:inherit; color:inherit; background:none; border:none; cursor:pointer}
input,select{font:inherit; color:var(--text)}
::-webkit-scrollbar{width:0;height:0}

/* --- Face / thumb primitives.
   These are <span> elements: they MUST be display:block or width/height do
   not apply (that bug blew the comp board and champion grid up to the
   images' natural 1024x512 size). Every face/thumb now has a definite box. --- */
.face,.thumb{display:block; position:relative; overflow:hidden; background:var(--bg2); flex:none}
.face img,.thumb img{width:100%; height:100%; object-fit:cover; position:relative; z-index:1}
.face .init,.thumb .init{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:800; color:var(--muted); z-index:0}

/* Header */
header{position:sticky; top:0; z-index:40; background:rgba(10,17,40,.94); backdrop-filter:blur(6px); border-bottom:1px solid var(--line)}
.header-in{max-width:var(--content-w); margin:0 auto; padding:10px 14px; display:flex; align-items:center; gap:10px}
.logo{display:flex; align-items:center; gap:10px; min-width:0}
.logo-mark{width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,var(--gold),#8a5f04); display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:800; color:#1a1200; flex:none; position:relative; overflow:hidden}
.logo-mark img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover}
.logo b{font-size:17px; letter-spacing:.2px; white-space:nowrap}
.logo small{display:block; color:var(--muted); font-size:11px; font-weight:400}
.header-in .spacer{flex:1}
.icon-btn{width:38px; height:38px; border-radius:50%; border:1px solid var(--line); background:var(--card); font-size:18px; display:flex; align-items:center; justify-content:center; flex:none}
.icon-btn.on{color:var(--gold); border-color:var(--gold)}
/* Mobile back button (phones only, every page except Home — shown by
   route() toggling .show). Lives in the sticky header, top-left, so it
   never covers page content or clashes with the bottom nav. */
.mobile-back{display:none}

/* Layout */
main{max-width:var(--content-w); margin:0 auto; padding:14px 14px 0; overflow-x:hidden; overflow-x:clip}
h1{font-size:21px; margin:2px 0 4px}
h2{font-size:16px; color:var(--gold); margin:18px 0 8px}
h2.teal{color:var(--teal)}
.sub{color:var(--muted); font-size:13px; margin-bottom:10px}
section{margin-bottom:6px}

/* Cards — display:block: several cards are <a> or <button> elements, and an
   inline card lets its block children (h3 / p.meta) escape the card's box,
   which is what clipped the Guides hub text at the left edge on phones. */
.card{display:block; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:14px; margin-bottom:12px; min-width:0; text-align:left; width:100%}
/* Guide hub grid: a real single-column grid on phones (it was only defined
   at min-width:900px, so on phones the hub was an unstyled div of inline
   cards). Two columns from 900px up. */
.meta-grid{display:grid; grid-template-columns:1fr; gap:10px; align-items:start}
.meta-grid .card{margin-bottom:0}
.card.gold-border{border-color:rgba(242,176,30,.55)}
.card.teal-border{border-color:rgba(45,212,191,.5)}
.card h3{font-size:16px}
.card .meta{color:var(--muted); font-size:13px; margin-top:2px}

/* Pills / badges */
.pill{display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:700; border:1px solid var(--line); background:var(--bg2); color:var(--text); white-space:nowrap}
.pill.gold{color:#1a1200; background:var(--gold); border-color:var(--gold)}
.pill.teal{color:#04211d; background:var(--teal); border-color:var(--teal)}
.pill.tier-S{color:#1a1200; background:var(--tierS); border-color:var(--tierS)}
.pill.tier-A{color:#04211d; background:var(--tierA); border-color:var(--tierA)}
.pill.tier-B{color:#081226; background:var(--tierB); border-color:var(--tierB)}
.pill.tier-C{color:#14181f; background:var(--tierC); border-color:var(--tierC)}
.pill.tier-X{color:#2b0a1e; background:var(--tierX); border-color:var(--tierX)}
.pill.cost-1{border-color:var(--cost1); color:var(--cost1)}
.pill.cost-2{border-color:var(--cost2); color:var(--cost2)}
.pill.cost-3{border-color:var(--cost3); color:var(--cost3)}
.pill.cost-4{border-color:var(--cost4); color:var(--cost4)}
.pill.cost-5{border-color:var(--cost5); color:var(--cost5)}
.pill.cost-7{border-color:var(--cost7); color:var(--cost7)}

/* Stat row (like the app's AVG / TOP 4 / WIN / PATCH strip) */
.stats{display:flex; border:1px solid var(--line); border-radius:12px; overflow:hidden; margin:10px 0}
.stats>div{flex:1; text-align:center; padding:9px 4px; background:var(--bg2); min-width:0}
.stats>div+div{border-left:1px solid var(--line)}
.stats label{display:block; font-size:10px; letter-spacing:.6px; color:var(--muted)}
.stats b{font-size:16px; color:var(--teal); overflow-wrap:anywhere}
.stats b.gold{color:var(--gold)} .stats b.purple{color:#c084fc}

/* Search + filters */
.search{width:100%; padding:11px 14px; border-radius:12px; border:1px solid var(--line); background:var(--card); outline:none; margin-bottom:10px}
.search:focus{border-color:var(--teal)}
.chips{display:flex; gap:8px; overflow-x:auto; padding-bottom:8px; margin-bottom:4px}
.chip{flex:none; padding:7px 13px; border-radius:999px; border:1px solid var(--line); background:var(--card); font-size:13px; font-weight:600}
.chip.on{background:var(--gold); color:#1a1200; border-color:var(--gold)}
.chip.teal-on.on{background:var(--teal); color:#04211d; border-color:var(--teal)}
select.sel{padding:9px 10px; border-radius:12px; border:1px solid var(--line); background:var(--card); max-width:100%}

/* Champion grid — portrait art cards (image on top, name + cost below) */
.grid{display:grid; grid-template-columns:repeat(4,1fr); gap:10px}
.unit{background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden; cursor:pointer; display:block; min-width:0}
.unit .face{width:100%; aspect-ratio:4/5; border-bottom:3px solid var(--cost1); border-radius:0}
.unit .face .init{font-size:20px}
.unit.c1 .face{border-bottom-color:var(--cost1)} .unit.c2 .face{border-bottom-color:var(--cost2)}
.unit.c3 .face{border-bottom-color:var(--cost3)} .unit.c4 .face{border-bottom-color:var(--cost4)}
.unit.c5 .face{border-bottom-color:var(--cost5)} .unit.c7 .face{border-bottom-color:var(--cost7)}
.unit .nm{display:block; font-size:12px; font-weight:600; line-height:1.2; word-break:break-word; padding:7px 6px 0}
.unit .sub2{display:block; font-size:11px; color:var(--muted); padding:1px 6px 7px}
.tier-head{display:flex; align-items:center; gap:8px; margin:16px 0 8px}
.tier-head .bar{flex:1; height:1px; background:var(--line)}
.cost-head{display:flex; align-items:center; gap:8px; margin:16px 0 8px}
.cost-head .bar{flex:1; height:1px; background:var(--line)}
.cost-head b{font-size:14px}
.cost-head b.c1{color:var(--cost1)} .cost-head b.c2{color:var(--cost2)} .cost-head b.c3{color:var(--cost3)}
.cost-head b.c4{color:var(--cost4)} .cost-head b.c5{color:var(--cost5)} .cost-head b.c7{color:var(--cost7)}

/* Rows (items / augments / traits / guides) */
.row{display:flex; gap:12px; align-items:center; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:10px 12px; margin-bottom:9px; cursor:pointer; width:100%; text-align:left; min-width:0}
.row .thumb{width:46px; height:46px; border-radius:10px; border:1px solid var(--line)}
.row .thumb .init{font-size:18px}
.row .body{flex:1; min-width:0}
.row .body b{font-size:15px; display:block}
.row .body span{font-size:12.5px; color:var(--muted); display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.row .chev{color:var(--muted2); font-size:18px; flex:none}
.roster{display:flex; flex-wrap:wrap; gap:6px; margin-top:8px}
.roster .face{width:34px; height:34px; border-radius:8px; border:2px solid var(--cost1)}
.roster .face .init{font-size:13px}
.roster .face.c2{border-color:var(--cost2)} .roster .face.c3{border-color:var(--cost3)}
.roster .face.c4{border-color:var(--cost4)} .roster .face.c5{border-color:var(--cost5)}
.roster .face.c7{border-color:var(--cost7)}

/* Buttons */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 18px; border-radius:14px; font-weight:700; font-size:15px; border:1px solid transparent}
.btn.gold{background:var(--gold); color:#1a1200; width:100%}
.btn.teal-o{background:rgba(45,212,191,.12); color:var(--teal); border-color:var(--teal); width:100%}
.btn.ghost{background:var(--card); border-color:var(--line); color:var(--text)}
.btn.block{width:100%}
.btn-row{display:flex; gap:10px; margin:12px 0}
.btn-row .btn{flex:1}

/* Hex board (4 rows x 7). minmax(0,1fr) + min-width:0 stop the grid blowing
   out to the images' natural width (the old repeat(7,1fr) let one 1024px
   splash stretch the whole board). */
.board{display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; margin:10px 0}
.board .cell{aspect-ratio:1; border-radius:8px; background:var(--bg2); border:1px solid var(--line); overflow:hidden; position:relative; min-width:0}
.board .cell .face{width:100%; height:100%; border-radius:0}
.board .cell .face .init{font-size:12px}
.board .cell.filled{border-color:var(--gold)}

/* Comp detail unit rows — the face here used to have no size at all */
.uface{width:56px; height:56px; border-radius:10px; border:2px solid var(--cost1); overflow:hidden; position:relative; flex:none; display:block; background:var(--bg2)}
.uface img{width:100%; height:100%; object-fit:cover; position:relative; z-index:1}
.uface .init{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:18px; color:var(--muted)}
.uface.c2{border-color:var(--cost2)} .uface.c3{border-color:var(--cost3)} .uface.c4{border-color:var(--cost4)}
.uface.c5{border-color:var(--cost5)} .uface.c7{border-color:var(--cost7)}

/* Bottom nav (phones only) */
nav.bottomnav{position:fixed; left:0; right:0; bottom:0; z-index:40; background:rgba(13,21,51,.97); border-top:1px solid var(--line)}
.nav-in{max-width:var(--content-w); margin:0 auto; display:flex}
.nav-in a{flex:1; text-align:center; padding:9px 0 10px; color:var(--muted); font-size:11.5px}
.nav-in a .ic{font-size:19px; display:block; line-height:1.1}
.nav-in a.on{color:var(--gold)}

/* Modal sheet */
.sheet-wrap{position:fixed; inset:0; z-index:60; background:rgba(2,4,12,.72); display:flex; align-items:flex-end; justify-content:center}
.sheet{background:var(--bg2); border:1px solid var(--line); border-bottom:none; border-radius:20px 20px 0 0; width:100%; max-width:720px; max-height:88vh; overflow-y:auto; padding:16px 16px 26px}
.sheet .grab{width:44px; height:4px; border-radius:2px; background:var(--muted2); margin:0 auto 12px}
.sheet .close{float:right; font-size:20px; color:var(--muted); padding:4px 8px}
.sheet h2{margin-top:0}
.detail-head{display:flex; gap:14px; align-items:center; margin-bottom:10px}
.detail-head .face{width:76px; height:76px; border-radius:14px; border:3px solid var(--cost1)}
/* Item sheets use a .thumb header with no size of its own: 64px item art
   rendered at natural size, but trait icons (256px, used as the emblem
   fallback) blew the header out and pushed the title off-screen. Pin it
   to 64px — the size item headers already rendered at — so emblem sheets
   (and trait sheets, same markup) show a proper icon + full title. */
.detail-head .thumb{width:64px; height:64px; border-radius:14px; border:1px solid var(--line)}
.detail-head .face .init{font-size:28px}
.detail-head.c2 .face{border-color:var(--cost2)} .detail-head.c3 .face{border-color:var(--cost3)}
.detail-head.c4 .face{border-color:var(--cost4)} .detail-head.c5 .face{border-color:var(--cost5)}
.detail-head.c7 .face{border-color:var(--cost7)}
.kv{font-size:14px; color:var(--text)}
.kv b{color:var(--gold)}
.tag-row{display:flex; flex-wrap:wrap; gap:7px; margin:8px 0}
.item-chip{display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--card); border-radius:999px; padding:5px 10px 5px 5px; font-size:13px}
.item-chip .thumb{width:24px; height:24px; border-radius:7px}
.item-chip .thumb .init{font-size:11px}
/* Tappable cards and chips are real <button>s: a tap opens the detail
   pop-up and must never select text or summon the phone browser's
   tap-to-search bar (the bug in the Rakan pop-up screenshots). */
.item-chip, .unit, .row, .face-btn, .linklike, [data-pop]{
  -webkit-tap-highlight-color:transparent; -webkit-touch-callout:none;
  user-select:none; -webkit-user-select:none; touch-action:manipulation}
button.unit{padding:0; text-align:left; width:100%}
.face-btn{padding:0; background:none; border:0; border-radius:10px; line-height:0}
.linklike{padding:0; color:var(--text); font:inherit; text-align:left}
/* Augment tier frame — drawn from the catalog tier (the source of truth),
   so the frame always matches the augment's real tier even when Riot's
   single-version icon art is gold-toned. Silver: grey, Gold: gold,
   Prismatic: pale lavender-blue with a glow. */
.thumb.aug-silver{border:2px solid #b9c2d4}
.thumb.aug-gold{border:2px solid var(--gold)}
.thumb.aug-prismatic{border:2px solid #c7d2fe; box-shadow:0 0 10px rgba(165,180,252,.55)}
.tips{margin:6px 0}
.tips li{margin:0 0 8px 18px; font-size:14px}
.tips li b{color:var(--gold)}
.muted{color:var(--muted)} .small{font-size:12.5px}
.notice{background:rgba(242,176,30,.1); border:1px solid rgba(242,176,30,.4); border-radius:12px; padding:11px 13px; font-size:13.5px; margin-bottom:12px}
.notice.teal{background:rgba(45,212,191,.08); border-color:rgba(45,212,191,.4)}
.empty{color:var(--muted); text-align:center; padding:28px 10px}
.loading{color:var(--muted); text-align:center; padding:40px 10px}
.toast{position:fixed; left:50%; bottom:calc(var(--nav-h) + 16px); transform:translateX(-50%); background:var(--card2); border:1px solid var(--teal); color:var(--text); padding:10px 16px; border-radius:999px; z-index:80; font-size:14px; box-shadow:0 6px 24px rgba(0,0,0,.5); max-width:92vw; text-align:center}
/* Live-sync banner: a catalog change (champion/item/augment data) needs a
   reload, because the new icons only ship with the build that published
   it. Stays until tapped — unlike the toast, it never auto-dismisses. */
.catalog-banner{position:fixed; left:50%; bottom:calc(var(--nav-h) + 16px); transform:translateX(-50%); background:var(--card2); border:1px solid var(--gold, #f2b01e); color:var(--text); padding:10px 14px; border-radius:12px; z-index:81; font-size:14px; box-shadow:0 6px 24px rgba(0,0,0,.5); max-width:92vw; text-align:center}
.catalog-banner button{margin-left:8px; background:var(--gold, #f2b01e); color:#111; border:0; border-radius:999px; padding:6px 14px; font-weight:700; cursor:pointer}
/* ---------- Homepage: logo banner + split screen ----------
   Two full-height halves (BROWSE / COMPOSITIONS), each a big clickable
   button over self-hosted League of Legends splash art. Hover lifts the
   image and reveals the "explore" line; focus does the same for keys. */
.home{flex:1; display:flex; flex-direction:column}
.home-banner{display:flex; align-items:center; gap:14px; flex-wrap:wrap; border:1px solid var(--line); border-radius:20px; padding:16px 18px; margin-bottom:14px; background:
  radial-gradient(220px 170px at 88% -10%, rgba(242,176,30,.30), transparent 70%),
  radial-gradient(260px 190px at -10% 115%, rgba(45,212,191,.24), transparent 70%),
  linear-gradient(160deg,#101a3e,#0a1128 62%)}
.home-logo{width:64px; height:64px; border-radius:16px; flex:none; box-shadow:0 4px 18px rgba(0,0,0,.5)}
.home-title{font-size:28px; line-height:1.1; margin:0}
.home-sub{color:var(--muted); font-size:13.5px; margin-top:3px}
.home-count{margin-left:auto}
.home-split{display:grid; grid-template-columns:1fr 1fr; gap:12px; flex:1; min-height:300px}
.home-half{position:relative; display:block; border-radius:20px; overflow:hidden; border:1px solid var(--line); min-height:340px; cursor:pointer; isolation:isolate}
.home-half-bg{position:absolute; inset:0; background-size:cover; background-position:center; transition:transform .6s cubic-bezier(.22,1,.36,1), filter .6s ease; z-index:0}
.home-half-shade{position:absolute; inset:0; z-index:1; background:linear-gradient(180deg, rgba(10,17,40,.18) 0%, rgba(10,17,40,.42) 52%, rgba(6,9,24,.88) 100%); transition:opacity .4s ease}
.home-half-text{position:absolute; z-index:2; left:0; right:0; bottom:0; padding:20px; display:flex; flex-direction:column; gap:5px; transition:transform .45s cubic-bezier(.22,1,.36,1)}
.home-half-text b{font-size:30px; letter-spacing:2.5px; color:#fff; text-shadow:0 2px 14px rgba(0,0,0,.75)}
.home-half-text i{font-style:normal; color:var(--text); opacity:.92; font-size:14px; text-shadow:0 1px 8px rgba(0,0,0,.8)}
.home-half-text em{font-style:normal; color:var(--gold); font-size:13px; font-weight:700; opacity:0; transform:translateY(6px); transition:opacity .35s ease .05s, transform .35s ease .05s}
.home-half:hover .home-half-bg, .home-half:focus-visible .home-half-bg{transform:scale(1.07); filter:brightness(1.12) saturate(1.1)}
.home-half:hover, .home-half:focus-visible{border-color:var(--gold); outline:none}
.home-half:hover .home-half-text, .home-half:focus-visible .home-half-text{transform:translateY(-4px)}
.home-half:hover .home-half-text em, .home-half:focus-visible .home-half-text em{opacity:1; transform:translateY(0)}
.home-half-faces{position:absolute; z-index:2; left:20px; bottom:118px; display:flex; gap:6px}
.home-half-faces .face{width:34px; height:34px; border-radius:8px; border:2px solid rgba(255,255,255,.65); box-shadow:0 2px 10px rgba(0,0,0,.6)}
.home-half-faces .face .init{font-size:13px}
.home-foot{color:var(--muted2); font-size:12.5px; text-align:center; margin-top:14px}
.home-banner, .home-split{animation:homeIn .55s cubic-bezier(.22,1,.36,1) both}
@keyframes homeIn{from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none}}

/* Comp detail collapsibles (mobile: the long sections start collapsed,
   tap-to-expand; desktop renders them open). The toggle reads as an h2. */
.collapse-toggle{display:flex; align-items:center; gap:8px; width:100%; text-align:left; color:var(--gold); font-size:16px; font-weight:700; margin:18px 0 8px; padding:0}
.collapse-toggle .collapse-meta{color:var(--muted); font-size:12px; font-weight:400}
.collapse-toggle .collapse-chev{margin-left:auto; color:var(--muted); transition:transform .25s ease}
.collapsible.open .collapse-chev{transform:rotate(90deg)}
@media (max-width:899px){
  .collapsible:not(.open) .collapsible-body{display:none}
}

/* ---------- Browse: category chooser → two-pane ----------
   #/browse shows the five categories centred. Clicking one docks the
   list to the left (width transition + dock slide) and the content
   slides in on the right. Both panes scroll on their own sides. */
.browse-wrap{display:flex; gap:14px; align-items:stretch; animation:paneIn .4s cubic-bezier(.22,1,.36,1) both}
.browse-nav{flex:none; width:100%; transition:width .5s cubic-bezier(.22,1,.36,1)}
.browse-wrap.chooser{justify-content:center}
.browse-wrap.chooser .browse-nav{max-width:880px}
.browse-wrap.chooser .browse-title,.browse-wrap.chooser .browse-sub,.browse-wrap.chooser .browse-nav-note{text-align:center}
.browse-wrap.split .browse-nav{width:288px; overflow-y:auto; scrollbar-width:thin; animation:dockLeft .5s cubic-bezier(.22,1,.36,1) both}
@keyframes dockLeft{from{opacity:.4; transform:translateX(9%)} to{opacity:1; transform:translateX(0)}}
.browse-title{font-size:24px; margin:2px 0 2px}
.browse-sub{color:var(--muted); font-size:13px; margin-bottom:12px}
.browse-cat{display:block; background:var(--card); border:1px solid var(--line); border-radius:16px; margin-bottom:12px; overflow:hidden; cursor:pointer; transition:border-color .25s ease, background .25s ease, transform .25s ease}
.browse-cat:hover{border-color:var(--gold); transform:translateY(-2px)}
.browse-cat.on{border-color:var(--gold); background:rgba(242,176,30,.1)}
.browse-cat-banner{display:block; height:190px; background-size:cover; background-position:center; border-bottom:1px solid var(--line); transition:height .4s ease}
/* Icon-strip banners (Items / Augments): the strip must fit the card at
   every width — the icons run edge to edge in the artwork, so `cover`
   cropped them at the sides. Sizing to the card's full width (height
   auto, centred) shows the whole strip, never clipped at the edges; the
   Champions splash keeps `cover` — it sits properly as a photo. */
.browse-cat-banner.banner-strip{background-size:100% auto; background-repeat:no-repeat; background-color:#070d1f}
.browse-cat-foot{display:flex; gap:12px; align-items:center; padding:14px 16px}
.browse-wrap.split .browse-cat-banner{display:none}
.browse-wrap.split .browse-cat-foot{padding:10px 12px}
.browse-cat-body{flex:1; min-width:0}
.browse-cat-body b{display:block; font-size:17px}
.browse-cat-body i{display:block; font-style:normal; font-size:12.5px; color:var(--muted); margin-top:2px}
.browse-wrap.split .browse-cat-body i{display:none}
.browse-cat-count{flex:none; font-size:12px; font-weight:700; color:var(--gold); border:1px solid var(--line); border-radius:999px; padding:4px 9px; white-space:nowrap}
.browse-wrap.split .browse-cat-count{display:none}
.browse-nav-note{color:var(--muted2); font-size:12px; margin-top:6px}
.browse-wrap.split{min-height:520px; height:calc(100dvh - 190px)}
.browse-content{flex:1; min-width:0; overflow-y:auto; overflow-x:hidden; border-radius:16px; scrollbar-width:thin; opacity:0; transform:translateX(26px); transition:opacity .45s ease .08s, transform .45s cubic-bezier(.22,1,.36,1) .08s}
.browse-wrap.split .browse-content{opacity:1; transform:none}
.browse-wrap.chooser .browse-content{display:none}
.browse-content .browse-pane{animation:paneIn .45s cubic-bezier(.22,1,.36,1) both}
@keyframes paneIn{from{opacity:0; transform:translateX(18px)} to{opacity:1; transform:none}}
.browse-back{display:none; margin-bottom:10px; font-weight:700}
.comps-view{animation:paneIn .45s cubic-bezier(.22,1,.36,1) both}

/* ---------- Contact ---------- */
.contact-card{max-width:640px}
.contact-form{display:flex; flex-direction:column; gap:12px; margin-top:12px}
.contact-form label{font-size:13px; font-weight:700; color:var(--muted); display:flex; flex-direction:column; gap:6px}
.contact-form input,.contact-form textarea,.contact-form select{width:100%; padding:11px 14px; border-radius:12px; border:1px solid var(--line); background:var(--bg2); color:var(--text); outline:none; font:inherit; resize:vertical}
.contact-form input:focus,.contact-form textarea:focus,.contact-form select:focus{border-color:var(--teal)}
/* Native drop-down lists (desktop): without this the closed control is
   dark but the opened list can render light. color-scheme: dark on :root
   covers it too; this is belt-and-braces for older browsers. */
select option{background:var(--bg2); color:var(--text)}
.donate-block{margin-top:18px; border-top:1px solid var(--line); padding-top:16px}
.donate-block p{color:var(--muted); font-size:13.5px; margin:0 0 10px}

/* ---------- Patch notes (inline, expandable) ---------- */
.patch-notes{margin-top:12px; border:1px solid var(--line); border-radius:12px; padding:10px 14px; background:var(--bg2)}
.patch-notes summary{cursor:pointer; font-weight:700; color:var(--gold); font-size:14px; padding:2px 0}
.patch-notes summary:hover{color:var(--text)}
.pn-src{margin:8px 0 4px}
.pn-intro blockquote{border-left:3px solid var(--gold); padding:4px 0 4px 12px; margin:10px 0; color:var(--text)}
.pn-h{font-size:16px; color:var(--gold); margin:18px 0 6px}
.pn-sub{font-size:14px; color:var(--teal); margin:12px 0 4px}
.pn-block p{margin:6px 0; font-size:14px}
.pn-block ul{margin:6px 0 6px 18px}
.pn-block li{margin:3px 0; font-size:14px}
.pn-block a{color:var(--teal)}

/* Respect reduced motion: everything appears at once, no slides. */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important}
}
.footer{color:var(--muted2); font-size:12px; text-align:center; padding:18px 10px 4px}

/* Env toggle (LIVE / PBE) — same switch the app has on its comp,
   champion and patch screens. */
.env-toggle{display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; margin-bottom:12px; background:var(--card)}
.env-toggle button{padding:8px 16px; font-weight:700; font-size:13px; color:var(--muted)}
.env-toggle button.on{background:var(--gold); color:#1a1200}
.env-toggle button.on:last-child{background:var(--teal); color:#04211d}

/* Comp list */
.comp-grid{display:grid; grid-template-columns:1fr; gap:10px; margin-bottom:6px}
.comp-card{display:block; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px 14px; min-width:0}
.comp-card:hover{border-color:var(--gold)}
.comp-card .comp-top{display:flex; align-items:center; justify-content:space-between; gap:8px}
.comp-card .comp-top b{font-size:15px}
.comp-card .comp-meta{color:var(--muted); font-size:12.5px; margin-top:3px}
.comp-card .comp-traits{display:flex; flex-wrap:wrap; gap:6px; margin-top:8px}
.comp-card .roster{margin-top:9px}
.comp-card .comp-src{color:var(--muted2); font-size:11.5px; margin-top:8px}

/* Comp detail */
.hex-stars{position:absolute; left:2px; top:1px; z-index:2; font-size:9px; color:var(--gold); text-shadow:0 1px 2px #000}
.board .cell .face{position:absolute; inset:0}
.urow{display:flex; gap:12px; align-items:flex-start; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:10px 12px; margin-bottom:9px; min-width:0}
.urow .ubody{flex:1; min-width:0}
.urow .ubody b{font-size:15px; display:block}
.urow .ubody b a{color:var(--text)}
.urow .ubody span{font-size:12.5px; color:var(--muted); display:block}
.urow .uitems{display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; max-width:46%}
.stage{background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin-bottom:10px}
.stage-head{display:flex; justify-content:space-between; gap:8px; align-items:baseline; margin-bottom:8px}

/* Champion hover popup — small card near the hovered/tapped champion,
   dark navy + gold/teal like the rest of the site. */
.champ-pop{position:fixed; z-index:90; display:none; width:280px; max-width:calc(100vw - 16px); background:var(--card2); border:1px solid var(--gold); border-radius:14px; padding:12px 14px; box-shadow:0 12px 32px rgba(0,0,0,.6)}
.champ-pop-close{position:absolute; top:6px; right:8px; font-size:16px; color:var(--muted); padding:4px 6px}
.champ-pop-head{display:flex; gap:10px; align-items:center; margin-bottom:4px}
.champ-pop-head .face{width:48px; height:48px; border-radius:10px; border:2px solid var(--cost1); flex:none}
.champ-pop-head .face .init{font-size:18px}
.champ-pop-head .face.c1{border-color:var(--cost1)} .champ-pop-head .face.c2{border-color:var(--cost2)}
.champ-pop-head .face.c3{border-color:var(--cost3)} .champ-pop-head .face.c4{border-color:var(--cost4)}
.champ-pop-head .face.c5{border-color:var(--cost5)} .champ-pop-head .face.c7{border-color:var(--cost7)}
.champ-pop-head b{font-size:16px}
.champ-pop-label{font-size:11px; letter-spacing:.8px; text-transform:uppercase; color:var(--muted); font-weight:700; margin:8px 0 2px}
.champ-pop .tag-row{margin:4px 0}
.champ-pop .item-chip{font-size:12px}

@media (min-width:640px){ .grid{grid-template-columns:repeat(6,1fr)} }
@media (min-width:900px){
  .comp-grid{grid-template-columns:1fr 1fr}
}

/* ---------- Desktop website layout ---------- */
@media (min-width:640px){ .grid{grid-template-columns:repeat(6,1fr)} }
@media (min-width:900px){
  body{padding-bottom:24px}
  main{padding:22px 20px 0}
  .header-in{padding:12px 20px}
  nav.bottomnav{display:none}
  .toast{bottom:24px}
  h1{font-size:26px}
  .home-title{font-size:34px}
  .home-logo{width:72px; height:72px}
  .home-split{flex:1; min-height:300px}
  .home-half{min-height:0}
  .meta-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start}
  .meta-grid .card{margin-bottom:0}
  .comp-layout{display:grid; grid-template-columns:minmax(0,7fr) minmax(0,5fr); gap:18px; align-items:start}
  /* Comp detail split: each column scrolls on its own — scrolling the
     board side never moves the guide side and vice versa. The page
     itself only scrolls the intro (title/stats) away; each column is
     capped at viewport height minus the sticky header (~66px), main
     padding (22px) and the bottom pad (24px + 6px section margin),
     so both columns stay fully reachable. */
  .comp-layout>div{max-height:calc(100dvh - 118px); overflow-y:auto; min-height:0}
  .list-2col{display:grid; grid-template-columns:1fr 1fr; gap:0 14px; align-items:start}
  .list-2col .tier-head{grid-column:1 / -1}
  /* Comp detail actions sit in a row on desktop (Code + Save comp side
     by side) instead of the full-width stacked buttons from the phone
     layout — same treatment the landscape block already gives them. */
  .comp-actions{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
  .comp-actions .btn{width:auto}
  .sheet-wrap{align-items:center; padding:20px}
  .sheet{border:1px solid var(--line); border-radius:20px; max-width:640px; max-height:85vh; padding:20px 22px 28px}
  .sheet .grab{display:none}
  .champ-tools{display:grid; grid-template-columns:1fr auto; gap:0 14px; align-items:end}
}
@media (min-width:1100px){ .grid{grid-template-columns:repeat(8,1fr)} }

/* ---------- Phones: split stacks, Browse panes stack with a back control ---------- */
@media (max-width:899px){
  /* Phones + tablets: the whole homepage — header card + BROWSE +
     COMPOSITIONS — fits on one screen with no scrolling, so the halves
     are compact fixed-height cards (the faces row is hidden: it would
     collide with the text in a 150px card). */
  .home-banner{padding:10px 12px; margin-bottom:10px}
  .home-logo{width:48px; height:48px}
  .home-title{font-size:22px}
  .home-sub{font-size:12px; margin-top:2px}
  .home-split{grid-template-columns:1fr; gap:10px; flex:1; min-height:0; grid-template-rows:1fr 1fr}
  .home-half{min-height:150px}
  .home-half-text{padding:14px}
  .home-half-text b{font-size:22px}
  .home-half-text i{font-size:12.5px}
  .home-half-faces{display:none}
  .home-foot{margin-top:8px; font-size:11.5px}
  .home-count{margin-left:0}
  .mobile-back.show{display:inline-flex}
  /* Phones + tablets: all five Browse category cards fit on one screen
     with no scrolling — compact banners, tighter card padding, and the
     instructional note hidden (the interaction is obvious from the cards). */
  .browse-title{font-size:19px; margin:0}
  .browse-sub{margin-bottom:6px}
  .browse-cat{margin-bottom:6px}
  .browse-cat-banner{height:64px}
  .browse-cat-foot{padding:8px 12px}
  .browse-cat-body b{font-size:16px}
  /* Five cards no longer fit with a description line each — hide it in
     the phone chooser (same as the desktop grid already does) so all five
     fit on one screen with labels and counts at full size. */
  .browse-wrap.chooser .browse-cat-body i{display:none}
  .browse-nav-note{display:none}
  /* The chooser stretches to fill the screen too: the five cards share
     the spare height (banners grow) instead of leaving dead space below
     the Guides card. Split mode is unaffected (nav hidden on phones). */
  .browse-wrap.chooser{flex:1}
  .browse-wrap.chooser .browse-nav{display:flex; flex-direction:column}
  .browse-wrap.chooser .browse-cat{display:flex; flex-direction:column; flex:1}
  .browse-wrap.chooser .browse-cat-banner{flex:1; min-height:48px}
  .browse-wrap.chooser .browse-cat-foot{flex:none}
  .browse-wrap.split{display:block; height:auto; min-height:0}
  .browse-wrap.split .browse-nav{display:none}
  .browse-wrap.split .browse-content{overflow:visible; opacity:1; transform:none}
  .browse-back{display:inline-block}
}

/* --- Phase 2 (5 Dec 2026): guides, tools, diffs, share card --- */
/* Data tables (unlocks, XP, econ, patch diffs, PBE-vs-LIVE). Wrap on
   phones instead of widening the page — main keeps overflow-x:clip. */
.dtable{width:100%; border-collapse:collapse; font-size:13.5px; margin:6px 0 12px; display:block; overflow-x:auto}
.dtable thead,.dtable tbody,.dtable tr{display:table; width:100%; table-layout:fixed}
.dtable th,.dtable td{padding:7px 8px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; overflow-wrap:anywhere}
.dtable th{color:var(--muted); font-size:11px; letter-spacing:.5px; text-transform:uppercase}
.dtable tr:last-child td{border-bottom:none}
/* Tool forms: two columns on desktop, one on phones. */
.tool-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:10px}
.tool-grid label{display:block; font-size:13px; color:var(--muted)}
.tool-grid label .sel,.tool-grid label .search{margin-top:4px}
@media (max-width:640px){.tool-grid{grid-template-columns:1fr}}
/* "What do I build" selected components. */
.item-chip.have-on{border-color:var(--gold); background:rgba(242,176,30,.14)}
/* Share card on comp detail — the prominent copy/share block. */
.share-card{border-color:rgba(242,176,30,.55)}
.share-card h3{color:var(--gold)}
.btn.block{display:block; width:100%; text-align:center}

/* ---------- Mobile landscape (short viewports, e.g. 844x390) ----------
   Height discipline: at 390px tall there are only ~269px of content
   between the sticky header and the fixed bottom nav, so width-driven
   layouts blow up (the comp board was 7 columns wide x 4 rows tall and
   filled the whole screen; the homepage halves stacked and the second
   one sat behind the nav). This block is LAST so it overrides the
   portrait phone rules above. Portrait rules are untouched. */
@media (orientation: landscape) and (max-height: 500px){
  main{padding:10px 14px 0}
  h1{font-size:18px}
  /* Comp detail: two columns (board left, level guide right) and the board
     sized by viewport HEIGHT, not width — cells shrink so the whole board
     fits in one viewport once scrolled to, with Traits readable below it
     and nothing under the bottom nav. */
  .comp-layout{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; align-items:start}
  /* Same independent column scrolling as desktop (see above): each
     side scrolls on its own, capped at viewport height minus the
     sticky header (~61px), main padding (10px), the fixed bottom nav
     (62px + 18px body pad) and the section margin (6px). */
  .comp-layout>div{max-height:calc(100dvh - 158px); overflow-y:auto; min-height:0}
  .board{max-width:calc((100dvh - 200px) * 7 / 4); margin-left:auto; margin-right:auto}
  .comp-actions{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
  .comp-actions .btn{width:auto; padding:8px 12px; font-size:13px}
  .stats{margin:8px 0}
  .stats>div{padding:6px 4px}
  .stats b{font-size:14px}
  /* Homepage: banner compact, halves side by side again (like desktop)
     at ~140px tall so header + both halves + footer fit on one screen. */
  .home-banner{padding:8px 12px; margin-bottom:10px}
  .home-logo{width:44px; height:44px}
  .home-title{font-size:20px}
  .home-count{display:none}
  .home-split{grid-template-columns:1fr 1fr; grid-template-rows:none; gap:10px; min-height:0}
  .home-half{min-height:132px}
  .home-foot{margin-top:4px}
  .home-half-text{padding:14px}
  .home-half-text b{font-size:22px}
  .home-half-text i{font-size:12.5px}
  /* Browse chooser: the five categories in one row of cards with compact
     banners and no description line, so all five fit on one screen. */
  .browse-wrap.chooser .browse-nav{display:grid; grid-template-columns:repeat(5,1fr); gap:10px; align-items:stretch; max-width:none}
  .browse-wrap.chooser .browse-nav>p:first-child, .browse-wrap.chooser .browse-title, .browse-wrap.chooser .browse-sub{grid-column:1 / -1}
  .browse-wrap.chooser .browse-title, .browse-wrap.chooser .browse-sub{text-align:left}
  .browse-wrap.chooser .browse-cat{margin-bottom:0}
  .browse-wrap.chooser .browse-cat-banner{flex:none; height:80px; min-height:0}
  /* Five cards share 844px, so a label + count pill cannot sit side by
     side in the foot (they overlapped: "Champions" painted over its
     pill). Stack them — label above, count below — the card is short
     enough in landscape that the extra row still fits one screen. */
  .browse-wrap.chooser .browse-cat-foot{flex-direction:column; align-items:flex-start; gap:4px; padding:8px 10px}
  .browse-wrap.chooser .browse-cat-body i{display:none}
  /* Guides hub: two columns instead of one, halving the scroll. */
  .meta-grid{grid-template-columns:1fr 1fr}
}

/* ---------- Drop-down controls (5 Dec 2026) ----------
   The comps page's search / sort / tier filter used to be horizontal
   scrolling chip rows. Now: three self-labelled drop-downs in a row —
   Search expands to the search field, Sort and Tier are native selects
   showing the current choice. The same pattern replaces the filter chip
   rows on the Browse panes (champion cost, item category, augment tier).
   No horizontal chip rows left on #/comps. */
.comp-controls{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:10px}
.dd-row{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:10px}
.dd-btn{display:flex; align-items:center; gap:6px; width:100%; min-width:0; padding:10px 10px; border-radius:12px; border:1px solid var(--line); background:var(--card); color:var(--text); font-size:13px; font-weight:600; cursor:pointer; text-align:left}
.dd-btn .dd-label{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.dd-btn .dd-chev{color:var(--muted); flex:none; font-size:11px}
.dd-btn[aria-expanded="true"]{border-color:var(--gold)}
.dd-select{width:100%; min-width:0; padding:10px 8px; border-radius:12px; border:1px solid var(--line); background:var(--card); color:var(--text); font-size:13px; font-weight:600; outline:none}
.dd-select:focus{border-color:var(--teal)}
.search-panel{display:flex; gap:8px; margin-bottom:10px}
.search-panel .search{margin-bottom:0; flex:1; min-width:0}
.search-panel .btn{flex:none; padding:10px 12px}
/* `hidden` must actually hide: .search-panel is display:flex and .btn is
   display:inline-flex, which both override the UA [hidden]{display:none}
   rule — without this, a closed search panel and an empty-query Clear
   button stayed visible on #/comps. */
.search-panel[hidden], .btn[hidden]{display:none}
.fav-toggle{display:inline-flex; align-items:center; gap:6px; padding:7px 12px; margin-bottom:10px; border-radius:999px; border:1px solid var(--line); background:var(--card); color:var(--muted); font-size:13px; font-weight:600; cursor:pointer}
.fav-toggle.on{color:var(--gold); border-color:var(--gold); background:rgba(242,176,30,.1)}

/* Sheet back button (nested sheets) + named roster faces (trait sheets):
   a champion tapped inside a sheet opens on top with ← Back; the roster
   shows each champion's name under its face. */
.sheet-back{display:inline-block; margin-bottom:10px; font-weight:700; font-size:14px; background:none; border:0; color:var(--teal); cursor:pointer; padding:0}
.roster-face{display:flex; flex-direction:column; align-items:center; gap:3px; width:54px; line-height:1.25}
.roster-name{font-size:11px; color:var(--text); text-align:center; overflow-wrap:anywhere}

/* Quest cards (5 Dec 2026): the trait thumb inside an h3 has no size from
   .row/.item-chip rules, so without this it renders at the icon's natural
   332px. Keep it a small inline icon like the chips. */
.quest-card h3 .thumb{display:inline-block; width:26px; height:26px; border-radius:7px; vertical-align:-6px; margin-right:6px; border:1px solid var(--line)}
.quest-card h3 .thumb .init{font-size:11px}

/* Unlocks page (5 Dec 2026): the condition must NEVER truncate — the
   generic .row .body span rule ellipsises to one line, which cut unlock
   conditions mid-sentence. Unlock rows wrap to as many lines as needed. */
.unlock-row .body span.unlock-cond{white-space:normal; overflow:visible; text-overflow:clip}
