/* Base reset (was the artifact host's page skeleton) */
:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#fff;color:#000}
img{max-width:100%}
[hidden]:not([hidden=until-found i]){display:none!important}

/* Layout: three role rows of loading-screen cards on the left, one sticky scouting panel on the right (moves under the active row on phones). */
:root {
  --bg: #0d1418;
  --surface: #152026;
  --raised: #1b2930;
  --line: #2a3a42;
  --fg: #e6ecec;
  --muted: #90a2a7;
  --brass: #cda95c;
  --brass-ink: #171204;
  --ban: #e5574e;
  --good: #52b98d;
  --warn: #dd9547;
  --on-art: #f3f1ea;
  --scrim: 8, 13, 16;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Barlow Semi Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #edf1f0; --surface: #ffffff; --raised: #f5f8f7; --line: #cdd7d6;
    --fg: #13222a; --muted: #55676d; --brass: #8a6a1c; --brass-ink: #ffffff;
    --ban: #c2372f; --good: #1c8259; --warn: #a8610f;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #edf1f0; --surface: #ffffff; --raised: #f5f8f7; --line: #cdd7d6;
  --fg: #13222a; --muted: #55676d; --brass: #8a6a1c; --brass-ink: #ffffff;
  --ban: #c2372f; --good: #1c8259; --warn: #a8610f;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--body); font-size: 16px; line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 20px; padding-block: 28px 48px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* Header */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.top h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 38px); letter-spacing: .04em; margin: 0; line-height: 1.05; }
.top p { margin: 6px 0 0; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.legend span.lab { margin-right: 4px; }

/* Tier badge */
.tier { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 6px; font-weight: 600; font-size: 13px; letter-spacing: .02em; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.tier[data-t="S+"] { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.tier[data-t="S"] { border-color: var(--brass); color: var(--brass); }
.tier[data-t="B"] { color: var(--muted); }
.tier[data-t="C"] { border-color: var(--warn); color: var(--warn); }
.tier[data-t="D"] { border-color: var(--ban); color: var(--ban); }

/* Board */
.board { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; margin-top: 24px; }
.roles { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
.role-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.role-head h2 { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.role-head .count { color: var(--muted); font-size: 14px; }
.role-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }

.card { position: relative; display: block; padding: 0; border: 1px solid var(--line); background: var(--surface); cursor: pointer; aspect-ratio: 3 / 4.6; overflow: hidden; text-align: left; transition: transform .16s ease, border-color .16s ease; }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transition: transform .3s ease; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(var(--scrim), .95) 0%, rgba(var(--scrim), .7) 26%, rgba(var(--scrim), 0) 55%); }
.card:hover { transform: translateY(-3px); border-color: var(--muted); }
.card:hover img { transform: scale(1.04); }
.card[aria-pressed="true"] { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); transform: translateY(-3px); }
.card .tier { position: absolute; top: 6px; left: 6px; z-index: 2; }
.card .meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 8px 9px 9px; color: var(--on-art); display: flex; flex-direction: column; gap: 1px; }
.card .nm { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .03em; line-height: 1.15; overflow-wrap: anywhere; }
.card .wr { font-size: 14px; opacity: .85; }

/* Scouting panel */
.panel { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.banner { position: relative; height: 170px; overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; display: block; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(var(--scrim), .96), rgba(var(--scrim), .15) 70%); }
.banner .who { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 2; color: var(--on-art); }
.banner .rl { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.banner h3 { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: .04em; margin: 0; line-height: 1.1; }
.pbody { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.stats { display: grid; grid-template-columns: auto 1fr 1fr 1fr; gap: 12px; align-items: end; }
.stats .k { display: block; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.stats .v { font-size: 20px; font-weight: 600; }
.sec h4 { margin: 0 0 4px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.sec.bans h4 { color: var(--ban); }
.sec.good h4 { color: var(--good); }
.sec .hint { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; }
.ico { position: relative; width: 44px; height: 44px; overflow: hidden; border: 1px solid var(--line); }
.ico img { width: 100%; height: 100%; display: block; transform: scale(1.12); }
.bans .ico { border-color: var(--ban); }
.bans .ico img { filter: grayscale(.75) brightness(.8); }
.bans .ico::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 2px), var(--ban) calc(50% - 2px), var(--ban) calc(50% + 2px), transparent calc(50% + 2px)); }
.row .line1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.row .onm { font-weight: 600; }
.row .owr { font-weight: 600; white-space: nowrap; }
.bans .owr { color: var(--ban); }
.good .owr { color: var(--good); }
.row > span:last-child { display: block; min-width: 0; }
.stats .v, .scale { display: block; }
.row .osub { display: block; color: var(--muted); font-size: 13px; }
.scale { position: relative; height: 6px; margin-top: 6px; background: var(--raised); border: 1px solid var(--line); }
.scale::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.scale i { position: absolute; top: -4px; width: 4px; height: 12px; margin-left: -2px; }
.bans .scale i { background: var(--ban); }
.good .scale i { background: var(--good); }
.axis { display: flex; justify-content: space-between; margin: 8px 0 0 56px; color: var(--muted); font-size: 12px; }
.notes { margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.notes p { margin: 0; }
.flex-btn { align-self: flex-start; background: none; border: 1px solid var(--brass); color: var(--brass); padding: 6px 12px; cursor: pointer; font-weight: 600; letter-spacing: .04em; }
.flex-btn:hover { background: var(--brass); color: var(--brass-ink); }
.foot { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; max-width: 70ch; }

@media (max-width: 1020px) {
  .board { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .panel { position: static; }
  .banner { height: 150px; }
}
@media (max-width: 700px) {
  .wrap { padding-inline: 16px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .card, .card img { transition: none; }
}

/* ---- View tabs + My Games view (added) ---- */
.tabs { display: flex; gap: 4px; margin-top: 14px; }
.tab { background: none; border: 1px solid var(--line); color: var(--muted); padding: 7px 14px; cursor: pointer; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.tab:hover { color: var(--fg); border-color: var(--muted); }
.tab[aria-selected="true"] { color: var(--brass-ink); background: var(--brass); border-color: var(--brass); }

.card .you { font-size: 12px; letter-spacing: .04em; color: var(--on-art); opacity: .95; }
.card .you b { font-weight: 600; }

.mine { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.mine h4 { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--brass); }
.mine .mrow { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.mine .rec { font-size: 20px; font-weight: 600; }
.mine .mstat { color: var(--muted); font-size: 14px; }
.mine .mstat b { color: var(--fg); font-weight: 600; }
.mine p { margin: 0; color: var(--muted); font-size: 14px; }
.linkish { background: none; border: 0; padding: 0; color: var(--brass); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; align-self: flex-start; }

.games { display: flex; flex-direction: column; gap: 40px; margin-top: 24px; }
.gsec h2 { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 4px; display: flex; align-items: baseline; gap: 12px; }
.gsec h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gsec .sub { margin: 0 0 16px; color: var(--muted); max-width: 70ch; }

.summary { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--surface); }
.summary > div { padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.summary > div:first-child { border-left: 0; }
.summary .k { display: block; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.summary .v { display: block; font-size: 26px; font-weight: 600; line-height: 1.2; }
.summary .big { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: .02em; }
.summary .n { display: block; color: var(--muted); font-size: 14px; }
.pos { color: var(--good); } .neg { color: var(--ban); }

.stints { display: flex; flex-direction: column; gap: 18px; }
.stint-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 8px; }
.stint-head strong { font-weight: 600; }
.stint-head span { color: var(--muted); font-size: 14px; }
.strip { display: flex; flex-wrap: wrap; gap: 4px; }
.pip { width: 22px; height: 30px; border: 2px solid var(--ban); background: transparent; padding: 0; cursor: default; position: relative; }
.pip.w { background: var(--good); border-color: var(--good); }
.pip.l::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; margin-top: -1px; background: var(--ban); }
.pip:hover, .pip:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }
.keyline { display: flex; gap: 16px; color: var(--muted); font-size: 13px; margin-top: 10px; align-items: center; }
.keyline .pip { width: 12px; height: 16px; pointer-events: none; }
.keyline .pip.l::after { left: 2px; right: 2px; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--raised); border: 1px solid var(--line); color: var(--fg); padding: 8px 10px; font-size: 14px; line-height: 1.35; max-width: 240px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.tip b { font-weight: 600; }
.tip .m { color: var(--muted); }

.splits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { border: 1px solid var(--line); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.split h3 { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; }
.bar .bl { font-weight: 600; }
.bar .bv { font-weight: 600; white-space: nowrap; }
.bar .bv small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.track { grid-column: 1 / -1; position: relative; height: 10px; background: var(--raised); border: 1px solid var(--line); }
.track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brass); }
.track::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--muted); }
.split .gap { margin: 0; color: var(--muted); font-size: 14px; }
.split .gap b { color: var(--fg); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table.gt { width: 100%; border-collapse: collapse; font-size: 15px; }
.gt th { text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gt td { padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gt tr:last-child td { border-bottom: 0; }
.gt .num { text-align: right; }
.gt tr.thin td { color: var(--muted); }
.who2 { display: flex; align-items: center; gap: 10px; }
.who2 img { width: 32px; height: 32px; border: 1px solid var(--line); display: block; }
.who2 .cn { font-weight: 600; color: var(--fg); }
.chip { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); color: var(--muted); padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.chip.pool { border-color: var(--brass); color: var(--brass); }
.res { display: inline-block; min-width: 30px; text-align: center; font-weight: 600; font-size: 13px; padding: 1px 6px; border: 1px solid; }
.res.w { color: var(--good); border-color: var(--good); }
.res.l { color: var(--ban); border-color: var(--ban); }

.opps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.opp { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--surface); padding: 8px; }
.opp img { width: 44px; height: 44px; display: block; border: 1px solid var(--line); }
.opp .on { font-weight: 600; display: block; }
.opp .or { font-size: 14px; color: var(--muted); display: block; }
.opp .or b { font-weight: 600; }
.opp.ban { border-color: var(--ban); }
.opp .flag { color: var(--ban); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; display: block; }

@media (max-width: 1020px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary > div { border-left: 0; border-top: 1px solid var(--line); }
  .summary > div:first-child { grid-column: 1 / -1; border-top: 0; }
  .summary > div:nth-child(odd):not(:first-child) { border-left: 1px solid var(--line); }
  .splits { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Build pane (added) ---- */
.card .ksb { position: absolute; inset: 6px 6px auto auto; z-index: 2; width: 26px; height: 26px; object-fit: contain; transform: none !important; border-radius: 50%; background: rgba(var(--scrim), .75); padding: 2px; border: 1px solid rgba(243, 241, 234, .25); }
.ptabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.ptab { background: none; border: 0; padding: 8px 10px; cursor: pointer; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; color: var(--muted); }
.ptab + .ptab { border-left: 1px solid var(--line); }
.ptab:hover { color: var(--fg); }
.ptab[aria-selected="true"] { background: var(--raised); color: var(--brass); box-shadow: inset 0 -2px 0 var(--brass); }
.pane { display: flex; flex-direction: column; gap: 18px; }
.bvar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bvar button { background: none; border: 1px solid var(--line); color: var(--muted); padding: 4px 10px; cursor: pointer; font-size: 13px; font-weight: 600; }
.bvar button[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); }
.bvar p { flex-basis: 100%; margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.bsec { display: flex; flex-direction: column; gap: 10px; }
.bhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; }
.bhead h4 { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--brass); }
.bstat { color: var(--muted); font-size: 13px; white-space: nowrap; }
.bi { display: block; width: 26px; height: 26px; flex: none; }
.runes { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; }
.rtree { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tlab { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.ks { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.ks .bi { width: 40px; height: 40px; }
.rlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rlist li { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.2; min-width: 0; }
.rlist li span { min-width: 0; overflow-wrap: anywhere; }
.rlist.shards .bi { width: 20px; height: 20px; border-radius: 50%; background: var(--raised); margin: 0 3px; }
.maxo { display: flex; align-items: center; gap: 8px; }
.kchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--raised); padding: 3px 8px 3px 3px; font-weight: 600; }
.kchip .bi { width: 28px; height: 28px; }
.maxo .arw { color: var(--muted); }
.lv-wrap { overflow-x: auto; }
table.lv { border-collapse: collapse; width: 100%; font-size: 12px; table-layout: fixed; min-width: 300px; }
.lv th { color: var(--muted); font-weight: 500; padding: 0 0 3px; text-align: center; }
.lv th:first-child { width: 28px; }
.lv tbody th .bi { width: 22px; height: 22px; }
.lv td { height: 22px; border: 1px solid var(--line); text-align: center; font-weight: 600; padding: 0; }
.lv td.on { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
.lv td.on.r { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ichip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 1.2; min-width: 0; }
.ichip .bi { width: 30px; height: 30px; border: 1px solid var(--line); }
.ichip small { color: var(--muted); font-size: 13px; }
.core { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.core > div { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; font-size: 13px; line-height: 1.2; }
.core .bi { width: 44px; height: 44px; border: 1px solid var(--brass); }
.core .st { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.later { display: flex; flex-direction: column; gap: 10px; }
.slot { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: start; }
.slot > b { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding-top: 8px; font-weight: 600; }
.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.opt { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 6px; align-items: center; min-width: 0; }
.opt .bi { width: 32px; height: 32px; border: 1px solid var(--line); }
.opt span { display: block; min-width: 0; font-size: 12px; line-height: 1.2; overflow-wrap: anywhere; }
.opt em { display: block; font-style: normal; color: var(--muted); font-size: 12px; }
.opt.top .bi { border-color: var(--brass); }
.bsrc { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.bsrc a { color: var(--brass); }
@media (max-width: 420px) {
  .runes, .pair { grid-template-columns: minmax(0, 1fr); }
  .opts { grid-template-columns: minmax(0, 1fr); }
}
