/* Loadout app – "inspection bench": gunmetal surfaces, drawing-grid stage with sight brackets,
   one red-dot accent. Team colours (T amber, CT blue) only ever mean a side. */

:root {
    --bg: #12161b;
    --bg-deep: #0e1115;
    --panel: #181d23;
    --panel-2: #1e242b;
    --line: #2a323b;
    --line-2: #3a444f;
    --text: #d9dee3;
    --muted: #8a94a0;
    --dim: #5f6974;
    --red: #ff3b4e;
    --red-ink: #1b0306;
    --t: #e7a54a;
    --ct: #5aa2ff;
    --side: var(--t);
    --display: 'Saira Condensed', 'Arial Narrow', sans-serif;
    --ui: 'IBM Plex Sans', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --bar: 60px;
    color-scheme: dark;
}
:root[data-view="ct"] { --side: var(--ct); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .stage-read dd { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

/* ---------- top bar ---------- */

.app { min-height: 100vh; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px; height: var(--bar); padding: 0 20px 0 16px; background: linear-gradient(180deg, #161b21, var(--bg-deep)); border-bottom: 1px solid var(--line); }
/* thin rule under the bar in the colour of the side being edited */
.bar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--side) 25%, var(--side) 75%, transparent); opacity: .45; pointer-events: none; transition: background .3s; }
.brand { display: flex; align-items: center; gap: 14px; align-self: stretch; padding-right: 20px; border-right: 1px solid var(--line); text-decoration: none; min-width: 0; }
.brand .logo { height: 34px; width: auto; max-width: 150px; object-fit: contain; }
.brand-name { font: 600 20px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; color: #eef1f4; }
.brand:hover .brand-name { color: #fff; }
.modes { display: flex; align-self: stretch; gap: 2px; }
.modes a { display: flex; align-items: center; gap: 9px; padding: 0 16px; text-decoration: none; color: var(--muted); font-weight: 500; position: relative; white-space: nowrap; transition: color .15s, background-color .15s; }
.modes a svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.modes a:hover { color: var(--text); background: rgb(255 255 255 / .03); }
.modes a[aria-current="page"] { color: #fff; background: linear-gradient(0deg, rgb(255 59 78 / .13), transparent 80%); }
.modes a[aria-current="page"] svg { color: var(--red); opacity: 1; }
.modes a[aria-current="page"]::after { content: ''; position: absolute; z-index: 1; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); box-shadow: 0 0 14px rgb(255 59 78 / .7); }

/* T / CT: a sliding block in the team colour */
.side-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-left: auto; padding: 3px; background: var(--bg); border: 1px solid var(--line-2); }
.side-switch::before { content: ''; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: var(--t); transition: translate .22s ease, background-color .22s; }
:root[data-view="ct"] .side-switch::before { translate: 100% 0; background: var(--ct); }
.side-switch button { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 7px; width: 66px; height: 30px; font: 600 15px/1 var(--display); letter-spacing: .06em; color: var(--muted); transition: color .2s; }
.side-switch button:hover { color: var(--text); }
.side-switch .emb { width: 22px; height: 22px; filter: grayscale(1) brightness(.75); transition: filter .2s; }
.side-switch button:hover .emb { filter: grayscale(.4); }
.side-switch button[aria-pressed="true"] { color: #10141a; }
.side-switch button[aria-pressed="true"] .emb { filter: none; box-shadow: 0 0 0 1px rgb(0 0 0 / .35); }

/* team emblems; the gradient underneath is the fallback when the image file is missing */
.emb { display: inline-block; width: 20px; height: 20px; flex: none; border-radius: 50%; background-position: center; background-size: 112%, cover; background-repeat: no-repeat; vertical-align: middle; }
.emb-t { background-image: url(../img/t.webp), radial-gradient(circle, #3a2b12 56%, var(--t) 60%); }
.emb-ct { background-image: url(../img/ct.webp), radial-gradient(circle, #121a23 56%, #7a93ab 60%); }
.emb-pair { display: inline-flex; flex: none; }
.emb-pair .emb + .emb { margin-left: -8px; }

.bar-end { display: flex; align-items: center; gap: 4px; }
.bar-sep { width: 1px; height: 24px; margin: 0 6px; background: var(--line); }
.bar-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 1px solid transparent; color: var(--muted); transition: color .15s, background-color .15s, border-color .15s; }
.bar-btn:hover, .bar-btn[aria-expanded="true"] { background: var(--panel); border-color: var(--line-2); color: var(--text); }
.bar-btn svg { width: 18px; height: 13px; flex: none; }
.bar-btn .chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: rotate .2s; }
.bar-btn[aria-expanded="true"] .chev { rotate: 180deg; }
.bar-btn-text { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn { padding-left: 4px; }
.user-btn .bar-btn-text { color: var(--text); font-weight: 500; }
.avatar { width: 28px; height: 28px; flex: none; outline: 1px solid var(--line-2); outline-offset: 1px; }
.avatar.initial { display: grid; place-items: center; background: var(--panel-2); font-weight: 600; font-size: 12px; color: var(--text); }
.menu-wrap { position: relative; }
.menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; background: var(--panel); border: 1px solid var(--line-2); border-top: 2px solid var(--red); z-index: 40; box-shadow: 0 24px 48px -16px #000; }
.menu[data-open] { display: block; animation: menu-in .14s ease-out; }
@keyframes menu-in { from { opacity: 0; translate: 0 -4px; } }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-decoration: none; color: var(--muted); }
.menu a svg { width: 18px; height: 13px; }
.menu a:hover { background: var(--panel-2); color: var(--text); }
.menu a[aria-current="true"] { color: var(--text); box-shadow: inset 2px 0 var(--red); }
.menu-id { margin: 0 0 4px; padding: 6px 10px 8px; font: 12px var(--mono); color: var(--dim); border-bottom: 1px solid var(--line); }

/* ---------- workspaces ---------- */

.view { flex: 1; min-height: 0; }
.ws { display: grid; height: calc(100dvh - var(--bar)); min-height: 520px; }
.ws-item { grid-template-columns: 252px minmax(0, 1fr) 372px; }
.ws-home { grid-template-columns: 252px minmax(0, 1fr); }
.ws-agents { grid-template-columns: minmax(0, 1fr) 380px; }
.ws-grid { display: block; height: auto; min-height: calc(100dvh - var(--bar)); }

.boot-msg { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 240px; color: var(--muted); }
.boot-msg.error { flex-direction: column; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- rail (weapon list) ---------- */

.rail { overflow-y: auto; border-right: 1px solid var(--line); padding: 0 0 24px; background: var(--bg-deep); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.rail-top { position: sticky; top: 0; z-index: 2; display: grid; gap: 8px; padding: 12px; background: linear-gradient(var(--bg-deep) 85%, rgb(14 17 21 / 0)); }
.rail-find { position: relative; display: block; }
.rail-find svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; translate: 0 -50%; fill: none; stroke: var(--dim); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.rail-find input { padding-left: 32px !important; }
.rail-find input, .find input { width: 100%; height: 36px; padding: 0 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: border-color .15s; }
.rail-find input:focus, .find input:focus { border-color: var(--line-2); outline: none; }
.rail-find input::placeholder, .find input::placeholder { color: var(--dim); }
.rail-home { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; font-weight: 600; color: var(--muted); transition: color .15s, border-color .15s; }
.rail-home svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.rail-home:hover { color: var(--text); border-color: var(--line-2); }
.rail-home[aria-current="page"] { color: #fff; border-color: var(--red); background: linear-gradient(90deg, rgb(255 59 78 / .14), var(--panel)); }
.rail-home[aria-current="page"] svg { color: var(--red); }
.rail-list, .rail-list ul { list-style: none; margin: 0; padding: 0; }
.rail-group h2 { display: flex; align-items: center; gap: 8px; margin: 14px 12px 6px; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.rail-group h2::after { content: ''; flex: 1; height: 1px; background: var(--line); order: 1; }
.rail-group h2 em { order: 2; font-style: normal; color: var(--line-2); }
.rail-group ul { display: grid; gap: 1px; padding: 0 6px; }
.rail-group a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 8px 4px 6px; text-decoration: none; color: var(--muted); transition: color .12s, background-color .12s; }
.rail-thumb { width: 52px; height: 30px; flex: none; display: grid; place-items: center; }
.rail-thumb img { max-width: 52px; max-height: 30px; object-fit: contain; opacity: .55; filter: grayscale(.6); transition: opacity .15s, filter .15s; }
.rail-group a.has-skin .rail-thumb img { opacity: .95; filter: none; }
.rail-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.rail-text > span, .rail-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-text > span { font-weight: 500; }
.rail-text small { font-size: 11.5px; color: var(--dim); }
.rail-group a:hover { color: var(--text); background: var(--panel); }
.rail-group a:hover .rail-thumb img { opacity: 1; filter: none; }
.rail-group a[aria-current="page"] { color: #fff; background: var(--panel-2); }
.rail-group a[aria-current="page"]::before { content: ''; position: absolute; left: -6px; top: 6px; bottom: 6px; width: 2px; background: var(--red); box-shadow: 0 0 10px var(--red); }
.rail-group a[aria-current="page"] .rail-thumb img { opacity: 1; filter: none; }
.rail-group a[aria-current="page"] small { color: var(--muted); }
.marks { display: inline-flex; gap: 3px; flex: none; }
.mk { display: inline-block; width: 7px; height: 7px; }
.mk.t { background: var(--t); }
.mk.ct { background: var(--ct); }

/* ---------- inspection stage ---------- */

/* two rows: the inspection area (everything absolutely placed inside grid area 1/1) and the dock under it */
.stage {
    --dock: 0px;
    position: relative; overflow: hidden; min-height: 0;
    display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
    background:
        radial-gradient(60% 55% at 50% 52%, rgb(255 255 255 / .045), transparent 70%),
        linear-gradient(rgb(255 255 255 / .028) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, rgb(255 255 255 / .028) 1px, transparent 1px) 0 0 / 48px 48px,
        var(--bg);
}
.br { position: absolute; width: 22px; height: 22px; border-color: var(--line-2); border-style: solid; border-width: 0; z-index: 2; pointer-events: none; }
.br.tl { top: 14px; left: 14px; border-top-width: 2px; border-left-width: 2px; }
.br.tr { top: 14px; right: 14px; border-top-width: 2px; border-right-width: 2px; }
.br.bl { bottom: 14px; left: 14px; border-bottom-width: 2px; border-left-width: 2px; }
.br.brr { bottom: 14px; right: 14px; border-bottom-width: 2px; border-right-width: 2px; }
.stage > * { grid-area: 1 / 1 / 2 / 2; }
.reticle { position: absolute; left: 50%; top: calc(50% - var(--dock, 0px) / 2); width: 120px; height: 120px; margin: -60px 0 0 -60px; pointer-events: none; opacity: .5;
    background:
        linear-gradient(var(--line-2), var(--line-2)) 50% 0 / 1px 34% no-repeat,
        linear-gradient(var(--line-2), var(--line-2)) 50% 100% / 1px 34% no-repeat,
        linear-gradient(var(--line-2), var(--line-2)) 0 50% / 34% 1px no-repeat,
        linear-gradient(var(--line-2), var(--line-2)) 100% 50% / 34% 1px no-repeat; }
.reticle::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.stage.ready .reticle { opacity: .18; }

.stage-3d { position: absolute; inset: 0 0 var(--dock) 0; z-index: 1; opacity: 0; transition: opacity .35s; }
.stage.ready .stage-3d { opacity: 1; }
.stage-3d canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.stage-3d canvas:active { cursor: grabbing; }
.stage-flat { position: absolute; left: 50%; top: calc(50% - var(--dock) / 2); translate: -50% -50%; max-width: min(70%, 640px); max-height: 60%; object-fit: contain; display: none; z-index: 1; filter: drop-shadow(0 22px 26px rgb(0 0 0 / .55)); }
.stage.flat .stage-flat { display: block; }
/* model has no texture for this skin: say so instead of showing the flat picture */
.stage.plain .stage-flat { display: none; }
.stage-notex { position: absolute; top: 28px; right: 32px; z-index: 3; display: none; flex-direction: column; width: 270px; background: rgb(14 17 21 / .88); border: 1px solid var(--line-2); border-top: 2px solid #f0a043; backdrop-filter: blur(6px); pointer-events: none; }
.stage.plain .stage-notex { display: flex; animation: toast-in .3s ease-out; }
.notex-img { display: grid; place-items: center; height: 120px; padding: 10px; background: radial-gradient(60% 65% at 50% 55%, rgb(255 255 255 / .07), transparent 72%); border-bottom: 1px solid var(--line); }
.notex-img img { max-width: 100%; max-height: 100px; object-fit: contain; filter: drop-shadow(0 10px 14px rgb(0 0 0 / .5)); }
.notex-text { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.notex-text > span { display: grid; gap: 2px; }
.stage-notex svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: #f0a043; stroke-width: 1.5; }
.stage-notex b { font: 600 15px/1.2 var(--display); letter-spacing: .05em; text-transform: uppercase; color: #f0a043; }
.stage-notex small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.stage.plain .stage-title { right: 330px; }
.stage-load { position: absolute; left: 50%; top: calc(50% - var(--dock) / 2); translate: -50% 60px; display: flex; gap: 10px; align-items: center; color: var(--muted); z-index: 2; }
.stage.ready .stage-load, .stage.flat .stage-load { display: none; }

.stage-title { position: absolute; left: 32px; top: 28px; right: 32px; z-index: 3; pointer-events: none; }
.st-weapon { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 500; }
.st-weapon span { padding: 3px 8px; border: 1px solid var(--line-2); background: rgb(14 17 21 / .6); font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.st-skin { margin: 8px 0 0; font: 600 clamp(32px, 3.4vw, 50px)/.95 var(--display); letter-spacing: .005em; color: #f1f4f6; text-wrap: balance; text-shadow: 0 2px 18px rgb(0 0 0 / .5); }
.st-mark { color: #f0a043; }
.st-tag { margin: 8px 0 0; color: var(--muted); font-style: italic; }

.stage-hint { position: absolute; right: 32px; bottom: calc(var(--dock) + 18px); z-index: 2; display: flex; align-items: flex-start; gap: 8px; max-width: 280px; margin: 0; font-size: 12px; line-height: 1.45; color: var(--dim); pointer-events: none; }
.stage-hint svg { width: 15px; height: 15px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* bottom dock: readouts on the left, sticker + charm slots on the right */
.stage > .stage-dock { grid-area: 2 / 1 / 3 / 2; position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; min-height: 96px; padding: 12px 20px; background: linear-gradient(180deg, #11151a, #0d1014); border-top: 1px solid var(--line); }
.dock-actions { display: flex; align-items: center; gap: 8px; padding-left: 18px; border-left: 1px solid var(--line); }
.decor-bar + .dock-actions { margin-left: 0; }
.stage-read + .dock-actions { margin-left: auto; }
.dock-save { flex: none; height: 50px; padding: 0 8px 0 20px; gap: 14px; font-size: 15px; letter-spacing: .01em; box-shadow: 0 10px 28px -12px rgb(255 59 78 / .8); }
.dock-save em { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 6px; background: rgb(0 0 0 / .28); font: 600 15px/1 var(--display); font-style: normal; letter-spacing: .05em; }
.dock-save em.side-2 { color: var(--t); }
.dock-save em.side-3 { color: var(--ct); }
.dock-save em.side-0 { color: #fff; }
.dock-remove { width: 50px; height: 50px; padding: 0; flex: none; }
.dock-remove svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock-remove:hover { color: var(--red); border-color: var(--red); }
.stage-read { display: flex; align-items: center; margin: 0; }
.stage-read > div { display: grid; align-content: center; gap: 6px; min-height: 48px; padding: 0 16px; border-left: 1px solid var(--line); }
.stage-read > div:first-child { padding-left: 0; border-left: 0; }
.stage-read dt { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.stage-read dd { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 19px; line-height: 1.1; color: var(--text); }
.stage-read abbr { padding: 2px 6px; background: var(--panel-2); border: 1px solid var(--line-2); font: 600 11px/1.2 var(--ui); color: var(--muted); text-decoration: none; }
.stage-read .side-2 { color: var(--t); }
.stage-read .side-3 { color: var(--ct); }
.stage-read dd .emb { align-self: center; }
.sr-meter { position: relative; display: block; width: 104px; height: 3px; background: linear-gradient(90deg, #4c7a62 0 7%, #5f8a5c 7% 15%, #8a8a54 15% 38%, #8a6a4a 38% 45%, #7a4646 45% 100%); }
.sr-meter i { position: absolute; top: -3px; width: 2px; height: 9px; translate: -50% 0; background: var(--text); box-shadow: 0 0 0 1px var(--bg-deep); }

.decor-bar { display: flex; align-items: flex-end; gap: 16px; margin-left: auto; }
.decor-group { display: grid; gap: 7px; }
.decor-group + .decor-group { padding-left: 16px; border-left: 1px solid var(--line); }
.decor-lbl { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.decor-slots { display: flex; gap: 6px; }
.slot { position: relative; width: 50px; height: 50px; display: grid; place-items: center; border: 1px dashed var(--line-2); background: var(--bg-deep); transition: border-color .15s, background-color .15s; }
.slot.full { border-style: solid; border-color: var(--line-2); background: var(--panel); }
.slot:hover { border-color: var(--muted); background: var(--panel-2); }
.slot.on { border: 1px solid var(--red); box-shadow: inset 0 0 0 1px var(--red), 0 0 16px -4px rgb(255 59 78 / .6); }
.slot img { width: 42px; height: 42px; object-fit: contain; }
.slot-plus { width: 14px; height: 14px; background: linear-gradient(var(--dim), var(--dim)) 50% / 14px 1.5px no-repeat, linear-gradient(var(--dim), var(--dim)) 50% / 1.5px 14px no-repeat; }
.slot:hover .slot-plus { background: linear-gradient(var(--text), var(--text)) 50% / 14px 1.5px no-repeat, linear-gradient(var(--text), var(--text)) 50% / 1.5px 14px no-repeat; }
.slot.charm { border-radius: 50%; }
.slot-id { font: 11px var(--mono); color: var(--muted); }
.slot-wrap { position: relative; display: block; }
.slot-x { position: absolute; top: -6px; right: -6px; z-index: 2; display: grid; place-items: center; width: 18px; height: 18px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 50%; color: var(--muted); opacity: 0; transition: opacity .15s, color .15s, background-color .15s; }
.slot-x svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.slot-wrap:hover .slot-x, .slot-x:focus-visible { opacity: 1; }
.slot-x:hover { background: var(--red); border-color: var(--red); color: #fff; }
@media (hover: none) { .slot-x { opacity: 1; } }

/* ---------- side panel ---------- */

.panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; height: 44px; color: var(--muted); font-weight: 500; position: relative; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.panel-head { padding: 18px 16px 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font: 600 24px/1.1 var(--display); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.find { display: block; }
.count { margin: 10px 0 8px; font-size: 12px; color: var(--dim); }

.skins, .picks, .agents, .cards { list-style: none; margin: 0; padding: 0; }
.skins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.skins > li { min-width: 0; }
.skin { position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; gap: 6px; padding: 8px 10px 10px; text-align: left; color: var(--muted); background: var(--bg-deep); border: 1px solid var(--line); transition: border-color .15s, background-color .15s, color .15s; }
.skin-img { display: grid; place-items: center; height: 76px; background: radial-gradient(60% 65% at 50% 55%, rgb(255 255 255 / .06), transparent 72%); }
.skin img { width: 100%; height: 76px; object-fit: contain; transition: transform .2s; }
.skin-name { font-size: 13px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.skin .marks { position: absolute; top: 8px; right: 8px; }
.skin:hover { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.skin:hover img { transform: scale(1.06); }
.skin.on { color: #fff; border-color: var(--red); background: linear-gradient(180deg, rgb(255 59 78 / .1), var(--bg-deep) 70%); box-shadow: inset 0 0 0 1px var(--red); }
li.empty { grid-column: 1 / -1; padding: 24px 0; color: var(--dim); text-align: center; }

.editor { display: grid; gap: 10px; }
/* settings cards */
.ed-sec { display: grid; gap: 12px; padding: 14px; background: var(--bg-deep); border: 1px solid var(--line); }
.ed-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ed-head svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--dim); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ed-title, .ed-title label { font: 500 11.5px/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.ed-meta { margin-left: auto; font: 12px var(--mono); color: var(--dim); white-space: nowrap; }
.ed-sec input[type="text"], .ed-sec input[type="number"] { height: 40px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); width: 100%; transition: border-color .15s; }
.ed-sec input:focus { border-color: var(--line-2); outline: none; }
.ed-sec input:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.ed-sec input::placeholder { color: var(--dim); }
.ed-sec .icon-btn { width: 40px; height: 40px; background: var(--panel); }
.dice svg { transition: rotate .25s; }
.dice:hover svg { rotate: 90deg; }

.team-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tp { display: flex; align-items: center; justify-content: center; gap: 9px; height: 46px; padding: 0 8px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); transition: border-color .15s, background-color .15s, color .15s; }
.tp b { font: 600 17px/1 var(--display); letter-spacing: .05em; }
.tp .emb { width: 24px; height: 24px; filter: grayscale(1) brightness(.7); transition: filter .15s; }
.tp .emb-pair .emb { width: 22px; height: 22px; }
.tp:hover { color: var(--text); border-color: var(--line-2); }
.tp:hover .emb { filter: grayscale(.3); }
.tp[aria-checked="true"], .tp.tp-on { color: #fff; }
.tp[aria-checked="true"] .emb, .tp.tp-on .emb { filter: none; }
.tp-1[aria-checked="true"], .tp-1.tp-on { border-color: var(--text); background: linear-gradient(180deg, rgb(255 255 255 / .08), var(--panel)); }
.tp-2[aria-checked="true"], .tp-2.tp-on { border-color: var(--t); background: linear-gradient(180deg, rgb(231 165 74 / .16), var(--panel)); color: var(--t); }
.tp-3[aria-checked="true"], .tp-3.tp-on { border-color: var(--ct); background: linear-gradient(180deg, rgb(90 162 255 / .16), var(--panel)); color: var(--ct); }
.ed-forced { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.ed-forced .emb { width: 26px; height: 26px; }

.wear-read { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wear-read output { font: 500 26px/1 var(--mono); color: #fff; }
.wear-read span { padding: 3px 8px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; font-weight: 500; color: var(--muted); }

.ed-st .st-row { display: flex; align-items: center; gap: 9px; }
.ed-st .st-row > svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--dim); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ed-st .st-name { flex: 1; font: 600 15px/1 var(--display); letter-spacing: .06em; color: var(--muted); }
.ed-st.is-on { border-color: rgb(240 160 67 / .45); background: linear-gradient(180deg, rgb(240 160 67 / .07), var(--bg-deep)); }
.ed-st.is-on .st-name { color: #f0a043; }
.ed-st.is-on .st-row > svg { stroke: #f0a043; }
.ed-st .st-count label { font-size: 12px; color: var(--dim); }
.field { display: grid; gap: 8px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.field label, .lbl { font-weight: 500; color: var(--text); }
.field output { color: var(--muted); font-size: 13px; }
.hint { margin: 0; color: var(--dim); font-size: 12px; }
.note { margin: 0; padding: 10px 12px; background: var(--panel-2); border-left: 2px solid var(--line-2); color: var(--muted); font-size: 13px; }
.field input[type="text"], .field input[type="number"] { height: 38px; padding: 0 10px; background: var(--bg-deep); border: 1px solid var(--line); color: var(--text); width: 100%; }
.field input:focus { border-color: var(--muted); outline: none; }
.field input:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.with-btn { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.icon-btn svg circle { fill: currentColor; stroke: none; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.seg button { height: 36px; padding: 0 6px; color: var(--muted); font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { color: #10141a; font-weight: 600; background: var(--text); }
.seg .seg-2[aria-checked="true"] { background: var(--t); }
.seg .seg-3[aria-checked="true"] { background: var(--ct); }

.wear-range { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; }
.wear-range::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, #4c7a62 0 7%, #5f8a5c 7% 15%, #8a8a54 15% 38%, #8a6a4a 38% 45%, #7a4646 45% 100%); }
.wear-range::-moz-range-track { height: 6px; background: linear-gradient(90deg, #4c7a62 0 7%, #5f8a5c 7% 15%, #8a8a54 15% 38%, #8a6a4a 38% 45%, #7a4646 45% 100%); }
.wear-range::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 22px; margin-top: -8px; background: #fff; border: 0; box-shadow: 0 0 0 2px var(--bg-deep), 0 2px 8px rgb(0 0 0 / .6); }
.wear-range::-moz-range-thumb { width: 8px; height: 22px; background: #fff; border: 0; border-radius: 0; box-shadow: 0 0 0 2px var(--bg-deep), 0 2px 8px rgb(0 0 0 / .6); }
.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.presets button { display: grid; gap: 3px; justify-items: center; padding: 7px 0 6px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); transition: color .15s, border-color .15s; }
.presets b { font: 600 13px/1 var(--mono); }
.presets small { font: 10px/1 var(--mono); color: var(--dim); }
.presets button:hover { color: var(--text); border-color: var(--line-2); }
.presets button.on { border-color: #fff; color: #fff; box-shadow: inset 0 -2px #fff; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; flex: none; background: var(--bg-deep); border: 1px solid var(--line-2); position: relative; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: var(--muted); transition: transform .15s; }
.switch input:checked + .track { border-color: #f0a043; }
.switch input:checked + .track::after { transform: translateX(16px); background: #f0a043; }
.switch input:focus-visible + .track { outline: 2px solid var(--red); outline-offset: 2px; }
.st-count { display: grid; gap: 6px; margin-top: 4px; }

.decor-list { display: grid; gap: 4px; }
.drow { display: flex; gap: 4px; }
.drow-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; background: var(--panel); border: 1px solid var(--line); text-align: left; transition: border-color .15s; }
.drow-main:hover { border-color: var(--line-2); }
.drow-img { width: 36px; height: 36px; flex: none; background: var(--bg-deep); display: grid; place-items: center; }
.drow-img img { width: 32px; height: 32px; object-fit: contain; }
.drow-text { min-width: 0; display: grid; }
.drow-text small { color: var(--dim); font-size: 11px; }
.drow-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .icon-btn { height: auto; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; bottom: -16px; margin: 0 -16px -16px; padding: 12px 16px 16px; background: linear-gradient(transparent, var(--panel) 30%); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid var(--line-2); font-weight: 600; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--red-ink); flex: 1; }
.btn.primary:hover { background: #ff5566; }
.btn.ghost { color: var(--muted); }
.btn.wide { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .55; cursor: progress; }
.link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

.picker-head { display: grid; gap: 6px; margin-bottom: 12px; justify-items: start; }
.picker-head h2 { margin: 0; font: 600 24px/1.1 var(--display); }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.picks button { width: 100%; display: grid; gap: 4px; justify-items: center; padding: 8px 4px; border: 1px solid transparent; font-size: 11px; color: var(--muted); text-align: center; }
.picks button:hover { border-color: var(--line-2); color: var(--text); background: var(--panel-2); }
.picks img { width: 72px; height: 72px; object-fit: contain; }
.picks span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- loadout overview ---------- */

.home { overflow-y: auto; padding: 28px 32px 48px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.home-head { max-width: 760px; }
.home-head h1 { margin: 0; font: 600 clamp(32px, 4vw, 48px)/1 var(--display); }
.home-head p { margin: 8px 0 0; color: var(--muted); max-width: 64ch; }
.kits { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 26px 0 34px; background: var(--line); border: 1px solid var(--line); }
.kit { display: grid; grid-template-rows: 96px auto; gap: 10px; padding: 14px; background: var(--panel); text-decoration: none; }
.kit:hover { background: var(--panel-2); }
.kit-img { display: grid; place-items: center; }
.kit-img img { max-height: 96px; max-width: 100%; object-fit: contain; }
.kit-img.none::before { content: ''; width: 44px; height: 44px; border: 1px dashed var(--line-2); }
.kit-text { display: grid; min-width: 0; }
.kit-text small { color: var(--dim); font-size: 12px; }
.kit-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger { display: grid; gap: 30px; }
.lsec h2 { margin: 0 0 8px; font: 600 22px/1.1 var(--display); color: var(--muted); }
.lrows { border-top: 1px solid var(--line); }
.lrow { display: grid; grid-template-columns: 96px minmax(0, 1fr) 160px minmax(0, 180px); align-items: center; gap: 18px; padding: 6px 10px; border-bottom: 1px solid var(--line); text-decoration: none; }
.lrow:hover { background: var(--panel); }
.lthumb img { width: 96px; height: 56px; object-fit: contain; }
.lname { display: grid; min-width: 0; }
.lname b { font-weight: 600; }
.lname span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lwear { display: grid; grid-template-columns: 1fr 26px; align-items: center; gap: 8px; }
.lwear i { display: block; height: 3px; background: linear-gradient(90deg, var(--text) var(--w), var(--line) var(--w)); }
.lwear em { font: normal 12px var(--mono); color: var(--muted); }
.lwear.empty { visibility: hidden; }
.ldecor { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chip { padding: 2px 8px; border: 1px solid var(--line-2); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- agents ---------- */

.agent-stage .stage-flat { max-height: 72%; }
.agent-act { position: absolute; left: 36px; bottom: 30px; z-index: 3; }
.equipped { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 1px solid var(--side); color: var(--side); font-weight: 600; }
.agents { display: grid; gap: 2px; }
.agent { width: 100%; display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 6px 8px; text-align: left; color: var(--muted); }
.agent:hover { background: var(--panel-2); color: var(--text); }
.agent.on { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 var(--red); }
.agent-img { width: 56px; height: 56px; display: grid; place-items: end center; overflow: hidden; background: var(--bg-deep); }
.agent-img img { width: 56px; height: 56px; object-fit: cover; object-position: top; }
.agent-text { display: grid; min-width: 0; }
.agent-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-text small { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- music kits / pins ---------- */

/* music kits / pins: showcase on the left, collection grid on the right */
.ws-collect { grid-template-columns: 340px minmax(0, 1fr); height: auto; min-height: calc(100dvh - var(--bar)); }
.showcase { position: sticky; top: var(--bar); align-self: start; display: flex; flex-direction: column; gap: 14px; height: calc(100dvh - var(--bar)); padding: 24px 22px; overflow-y: auto; background: var(--bg-deep); border-right: 1px solid var(--line); }
.sc-eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.sc-stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 24px; border: 1px solid var(--line);
    background: radial-gradient(55% 55% at 50% 50%, rgb(255 255 255 / .08), transparent 70%), linear-gradient(rgb(255 255 255 / .03) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgb(255 255 255 / .03) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg); }
.sc-stage img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 18px 24px rgb(0 0 0 / .55)); animation: sc-in .3s ease-out; }
.sc-stage.none::before { content: ''; width: 64px; height: 64px; border: 1px dashed var(--line-2); }
@keyframes sc-in { from { opacity: 0; scale: .94; } }
.sc-name { margin: 0; font: 600 26px/1.05 var(--display); color: #f1f4f6; text-wrap: balance; }
.sc-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sc-equip { display: grid; gap: 8px; }
.sc-lbl { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.sc-equip .link { justify-self: start; font-size: 13px; }
.sc-sides { list-style: none; display: grid; gap: 6px; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.sc-sides li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sc-sides .emb { width: 26px; height: 26px; }
.sc-sides span { display: grid; min-width: 0; line-height: 1.3; }
.sc-sides small { font-size: 11px; color: var(--dim); }
.sc-sides b { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.collect { padding: 28px 32px 64px; min-width: 0; }
.collect-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.collect-head h1 { margin: 0; font: 600 clamp(32px, 4vw, 48px)/1 var(--display); }
.collect-head p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
.collect-find { width: min(340px, 100%); }
.collect .count { margin: 20px 0 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; margin: 0; }
.cards-pins { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.cards > li { min-width: 0; }
.card { position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; gap: 10px; padding: 10px 10px 12px; background: var(--panel); border: 1px solid var(--line); text-align: left; color: var(--muted); transition: border-color .15s, background-color .15s, color .15s; }
.card-img { display: grid; place-items: center; aspect-ratio: 4 / 3; background: radial-gradient(60% 60% at 50% 50%, rgb(255 255 255 / .06), transparent 72%), var(--bg-deep); }
.cards-pins .card-img { aspect-ratio: 1; }
.card-img img { max-width: 82%; max-height: 82%; object-fit: contain; transition: transform .2s; }
.card-name { font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card:hover { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.card:hover .card-img img { transform: scale(1.06); }
.card.is-eq { border-color: var(--line-2); color: var(--text); }
.card.on { border-color: var(--red); color: #fff; box-shadow: inset 0 0 0 1px var(--red), 0 10px 26px -14px rgb(255 59 78 / .7); }
.card-eq { position: absolute; top: 8px; right: 8px; display: inline-flex; gap: 3px; padding: 3px; background: rgb(14 17 21 / .85); border: 1px solid var(--line-2); border-radius: 999px; }
.card-eq .emb { width: 20px; height: 20px; }
.card-eq .emb-pair .emb { width: 18px; height: 18px; }


/* ---------- tooltips (initTips in app.js) ---------- */

.tip { position: fixed; z-index: 80; max-width: 280px; padding: 7px 11px; background: #0b0e12; border: 1px solid var(--line-2); box-shadow: 0 12px 28px -10px #000; color: var(--text); font: 500 12.5px/1.4 var(--ui); pointer-events: none; opacity: 0; translate: 0 4px; transition: opacity .12s, translate .12s; }
.tip.below { translate: 0 -4px; }
.tip.show { opacity: 1; translate: 0 0; }
.tip::after { content: ''; position: absolute; left: var(--arrow, 50%); top: 100%; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #0b0e12; border: solid var(--line-2); border-width: 0 1px 1px 0; rotate: 45deg; }
.tip.below::after { top: 0; border-width: 1px 0 0 1px; }
/* ---------- toasts ---------- */

#toasts { position: fixed; left: 50%; top: calc(var(--bar) + 14px); translate: -50% 0; z-index: 60; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { position: relative; display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: min(480px, calc(100vw - 32px)); padding: 9px 20px 9px 9px; overflow: hidden; background: rgb(24 29 35 / .96); border: 1px solid var(--line-2); box-shadow: 0 20px 44px -14px #000; backdrop-filter: blur(8px); font-weight: 500; color: var(--text); pointer-events: auto; animation: toast-in .28s cubic-bezier(.2, .8, .2, 1); transition: opacity .3s, translate .3s; }
.toast-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: rgb(89 196 138 / .14); color: #59c48a; }
.toast-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.toast-icon:has(.emb) { background: none; }
.toast-icon > .emb { width: 34px; height: 34px; }
.toast-icon .emb-pair .emb { width: 26px; height: 26px; }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #59c48a; transform-origin: left; animation: toast-time 3s linear forwards; }
.toast.error .toast-icon { background: rgb(255 59 78 / .14); color: var(--red); }
.toast.error .toast-bar { background: var(--red); }
.toast.out { opacity: 0; translate: 0 -8px; }
@keyframes toast-in { from { opacity: 0; translate: 0 -12px; } }
@keyframes toast-time { to { transform: scaleX(0); } }

/* ---------- footer ---------- */

.foot { position: relative; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-deep), #0b0d10); color: var(--muted); font-size: 13px; }
.foot::before { content: ''; position: absolute; left: 0; top: -1px; width: 96px; height: 2px; background: var(--red); }
.foot-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px 40px; padding: 24px; }
.foot-brand { display: grid; gap: 6px; }
.foot-name { font: 600 21px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.foot-sub { font-size: 12.5px; color: var(--dim); }
.foot-sub a, .foot-base a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-2); transition: color .15s, border-color .15s; }
.foot-sub a:hover, .foot-base a:hover { color: var(--text); border-color: var(--red); }
.foot-note { justify-self: center; display: flex; align-items: flex-start; gap: 10px; max-width: 70ch; margin: 0; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--line-2); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.foot-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.foot-links { display: flex; gap: 8px; }
.foot-links a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line-2); color: var(--muted); text-decoration: none; font-weight: 500; transition: color .15s, border-color .15s, background-color .15s; }
.foot-links a:hover { color: var(--text); border-color: var(--muted); background: var(--panel); }
.foot-links svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 12px 24px; border-top: 1px solid var(--line); font: 12px/1.5 var(--mono); color: var(--dim); }

/* ---------- sign in ---------- */

.signin { min-height: calc(100vh - 50px); display: flex; flex-direction: column; }
.signin-bar { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--bg-deep); }
.signin-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.signin-brand .logo { height: 40px; width: auto; max-width: 170px; object-fit: contain; }
.signin-brand span { font: 600 20px/1 var(--display); white-space: nowrap; }
.signin-main { flex: 1; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 300px); align-content: center; justify-content: center; gap: 48px; padding: 48px 16px; position: relative;
    background:
        linear-gradient(rgb(255 255 255 / .028) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, rgb(255 255 255 / .028) 1px, transparent 1px) 0 0 / 48px 48px; }
.signin-scope { position: absolute; inset: 24px; pointer-events: none; }
.signin-scope .reticle { opacity: .35; }
.signin-card { position: relative; z-index: 1; }
.signin-card h1 { margin: 0; font: 600 clamp(44px, 7vw, 76px)/.9 var(--display); }
.signin-card p { color: var(--muted); max-width: 46ch; margin: 16px 0 28px; }
.signin-card .fine { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.btn.steam { flex: none; height: 46px; padding: 0 22px; }
.btn.steam svg { width: 20px; height: 20px; fill: currentColor; }
.signin-list { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; align-self: center; display: grid; gap: 18px; }
.signin-list li { padding-left: 18px; border-left: 1px solid var(--line-2); color: var(--muted); }

/* ---------- smaller screens ---------- */

@media (max-width: 1240px) {
    .ws-item { grid-template-columns: 200px minmax(0, 1fr) 330px; }
    .kits { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .brand-name { display: none; }
    .modes a { padding: 0 12px; }
    .stage-hint { display: none; }
    .stage-read > div { padding: 0 14px; }
    .sr-meter { width: 96px; }
    .slot { width: 44px; height: 44px; }
    .slot img { width: 38px; height: 38px; }
}

@media (max-width: 980px) {
    .bar { flex-wrap: wrap; height: auto; padding: 8px 12px 0; gap: 8px 12px; }
    .brand { padding-right: 0; border-right: 0; }
    .modes { order: 5; width: calc(100% + 24px); margin: 0 -12px; overflow-x: auto; border-top: 1px solid var(--line); height: 44px; }
    .modes a { flex: 1 0 auto; justify-content: center; }
    .bar-btn-text, .bar-sep, .bar-btn .chev { display: none; }
    .side-switch button { width: 50px; gap: 4px; }
    .side-switch .emb { width: 18px; height: 18px; }
    .bar-end { gap: 2px; }
    .bar-btn { padding: 0 6px; }
    .foot-main { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
    .foot-note { justify-self: start; }
    .foot-base { padding: 12px 16px; }
    .ws { height: auto; min-height: 0; }
    .ws-item, .ws-home, .ws-agents { grid-template-columns: minmax(0, 1fr); }
    .rail { max-height: 200px; border-right: 0; border-bottom: 1px solid var(--line); }
    .stage { height: 62vh; min-height: 380px; }
    .agent-stage { height: 70vh; }
    .panel { border-left: 0; border-top: 1px solid var(--line); }
    .panel-body { overflow: visible; }
    .stage-title, .stage.plain .stage-title { left: 20px; top: 18px; right: 20px; }
    .stage-notex { top: auto; bottom: 14px; left: 20px; right: 20px; width: auto; flex-direction: row; }
    .notex-img { height: auto; width: 110px; border-bottom: 0; border-right: 1px solid var(--line); }
    .notex-img img { max-height: 60px; }
    .stage { height: 78vh; }
    .stage > .stage-dock { gap: 12px; padding: 10px 12px; }
    .dock-actions { width: 100%; padding-left: 0; border-left: 0; }
    .dock-save { flex: 1; }
    .stage-read > div { min-height: 0; }
    .decor-bar { margin-left: 0; gap: 10px; }
    .decor-group + .decor-group { padding-left: 10px; }
    .decor-slots { gap: 4px; }
    .slot { width: 40px; height: 40px; }
    .slot img { width: 34px; height: 34px; }
    .skin-img, .skin img { height: 64px; }
    .agent-act { left: 20px; bottom: 18px; }
    .home, .collect { padding: 20px 16px 48px; }
    .ws-collect { grid-template-columns: minmax(0, 1fr); }
    .showcase { position: static; height: auto; padding: 18px 16px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 14px; }
    .showcase > * { grid-column: 2; }
    .showcase .sc-stage { grid-column: 1; grid-row: 1 / span 3; padding: 10px; }
    .showcase .sc-equip, .showcase .sc-sides { grid-column: 1 / -1; }
    .cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .kits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lrow { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
    .lthumb img { width: 72px; height: 44px; }
    .lwear, .ldecor { grid-column: 2; }
    .lwear.empty { display: none; }
    .ldecor { justify-content: flex-start; }
    .signin-main { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .actions { position: static; margin: 0; padding: 0; background: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
