/* Lobby: the menu shell (#loadout.lobby) with a persistent header, pages and the queue footer. It extends the menu's
   own system in index.html (type, the 210 | 1fr | 330 columns, chips, stat bars, amber for "this one"), drawn for
   1280x760 and zoomed by LoadoutUI._fit like the loadout screen. Pages are subgrids, so every page lines up on the
   same three columns as the loadout. Nothing here blurs; low detail needs no exceptions. */

#loadout.lobby { --lb-ease: var(--out); }
#loadout.lobby #lo-head { display: grid; grid-template-columns: subgrid; align-items: end; height: 40px; }
#loadout.lobby #lo-head h1 { height: 32px; align-self: end; margin-bottom: 4px; }
#loadout.lobby #lo-run { display: none; }
#loadout.lobby #lo-settings { display: none; }

/* ---------------------------------------------------------------- header: sections and level */
#lb-nav { display: flex; gap: 34px; align-self: stretch; align-items: flex-end; border-bottom: 1px solid var(--line); }
#loadout #lb-nav button { position: relative; font-size: 15px; font-weight: 600; letter-spacing: .22em; margin-right: -.22em; line-height: 1;
  color: var(--dim); padding: 0 0 13px; transition: color .12s; }
#loadout #lb-nav button:hover { color: var(--fg); }
#loadout #lb-nav button.on { color: var(--fg); }
#loadout #lb-nav button::after { content: ''; position: absolute; left: 0; right: .22em; bottom: -1px; height: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform .18s var(--lb-ease); }
#loadout #lb-nav button.on::after { transform: scaleX(1); }
#loadout #lb-nav button[hidden] { display: none; }

/* the level: emblem, then LEVEL and the XP figures over a bar that sits on the nav's baseline */
#lb-level { display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; align-items: end; align-self: stretch; }
#lb-level .xp { display: flex; flex-direction: column; gap: 10px; padding-bottom: 0; }
#lb-level .xp .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; letter-spacing: .2em; color: var(--dim); line-height: 1; }
#lb-level .xp .row span { letter-spacing: .06em; }
#lb-level .xp .row b { color: var(--fg); font-weight: 600; }
#lb-level .lb-emb { align-self: center; }
.lb-bar { position: relative; height: 4px; background: rgba(242,244,245,.13); overflow: hidden; }
.lb-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--fg); transition: width .22s var(--lb-ease); }
.lb-bar i.gain { background: var(--accent); }
#lb-level .lb-bar { height: 3px; margin-bottom: -1px; }

/* the level emblem: a hexagon with the number set in it */
.lb-emb { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; color: var(--fg); }
.lb-emb svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: currentColor; }
.lb-emb b { position: relative; font: 800 17px/1 var(--display); letter-spacing: .02em; padding-top: 1px; }
.lb-emb.big { width: 56px; height: 56px; } .lb-emb.big b { font-size: 24px; }

.lb-ico { width: 18px; height: 18px; fill: currentColor; flex: none; display: block; }

/* ---------------------------------------------------------------- pages */
.lb-page { grid-row: 2; grid-column: 1 / -1; display: none; grid-template-columns: subgrid; min-height: 0; }
#loadout.lobby[data-page="play"] #lb-play, #loadout.lobby[data-page="mastery"] #lb-mastery, #loadout.lobby[data-page="summary"] #lb-summary { display: grid; }
#loadout.lobby:not([data-page="loadout"]) :is(#lo-classes, #lo-main, #lo-side) { display: none; }
#loadout.lobby .lb-page, #loadout.lobby[data-page="loadout"] :is(#lo-classes, #lo-main, #lo-side), #loadout.lobby #settings.show { animation: lb-in .2s var(--lb-ease); }
@keyframes lb-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* section label: the attachment-slot label, with a figure on its right */
.lb-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: .18em; color: var(--dim); margin-bottom: 14px; }
.lb-h span { font-size: 13px; letter-spacing: .08em; color: var(--faint); }

/* ---------------------------------------------------------------- PLAY */
#lb-cards { grid-column: 1 / 3; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) 96px; gap: 10px; min-height: 0; }
#loadout .lb-card { position: relative; display: block; text-align: left; overflow: hidden; background: #101317; min-height: 0;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .12s; }
#loadout .lb-card .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(.55) brightness(.62); transform: scale(1.02); transition: filter .2s, transform .5s var(--lb-ease); }
#loadout .lb-card::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,9,11,.55), rgba(7,9,11,0) 34%, rgba(7,9,11,0) 50%, rgba(7,9,11,.88)); }
#loadout .lb-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .22s var(--lb-ease); }
#loadout .lb-card:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--faint); }
#loadout .lb-card:hover:not(:disabled) .art { filter: saturate(.7) brightness(.74); }
#loadout .lb-card.on .art { filter: saturate(.85) brightness(.86); transform: scale(1); }
#loadout .lb-card.on::after { transform: scaleX(1); }
#loadout .lb-card:focus-visible { outline-offset: 3px; }
.lb-card .mode { position: absolute; left: 18px; top: 17px; display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; letter-spacing: .2em; line-height: 1; color: var(--fg); text-shadow: var(--shade); }
.lb-card .mode .lb-ico { width: 17px; height: 17px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.lb-card .name { position: absolute; left: 17px; bottom: 19px; font: 800 46px/.8 var(--display); letter-spacing: .05em; color: var(--fg); text-shadow: 0 2px 14px rgba(0,0,0,.6); }
.lb-card .tag { position: absolute; right: 16px; top: 14px; font-style: normal; font-size: 12px; font-weight: 600; letter-spacing: .2em; margin-right: -.2em; line-height: 1; padding: 5px 7px 4px 8px; color: var(--accent); box-shadow: inset 0 0 0 1px rgba(255,176,0,.55); background: rgba(7,9,11,.5); }
/* not available: no picture, the mode mark in its place */
#loadout .lb-card.off { background: var(--fill); cursor: default; }
.lb-card.off .mode, .lb-card.off .name { color: var(--faint); text-shadow: none; }
.lb-card.off .mode { display: none; }
.lb-card.off .name { font-size: 30px; top: 50%; bottom: auto; left: 72px; transform: translateY(-42%); }
.lb-card.off::before { display: none; }
.lb-card.off .big { position: absolute; left: 20px; top: 50%; width: 34px; height: 34px; margin-top: -17px; fill: rgba(242,244,245,.22); }
.lb-card.off .tag { color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); background: none; top: 50%; transform: translateY(-50%); }

#lb-side { grid-column: 3; display: grid; grid-template-rows: minmax(0, 1fr) 96px; gap: 10px; min-height: 0; }
.lb-panel { display: flex; flex-direction: column; min-height: 0; padding: 18px 20px 6px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.lb-panel .lb-h { margin-bottom: 4px; }
.lb-panel .lb-chs { flex: 1; gap: 0; }
.lb-panel .lb-ch { flex: 1; align-content: center; border-top: 1px solid rgba(242,244,245,.08); padding: 14px 0; }
.lb-panel .lb-ch:first-child { border-top: 0; }
.lb-chs { display: flex; flex-direction: column; gap: 18px; }
.lb-ch { display: grid; grid-template-columns: 22px 1fr; column-gap: 14px; align-items: start; }
.lb-ch > .lb-ico { width: 22px; height: 22px; color: var(--dim); margin-top: -3px; }
.lb-ch .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 9px; line-height: 1; }
.lb-ch .top b { font-size: 16px; font-weight: 600; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-ch .top span { font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--dim); white-space: nowrap; }
.lb-ch .top span em { font-style: normal; color: var(--fg); }
.lb-ch .foot { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12px; font-weight: 600; letter-spacing: .14em; line-height: 1; color: var(--faint); }
.lb-ch.done > .lb-ico { color: var(--accent); }
.lb-ch.done .lb-bar i { background: var(--accent); }
.lb-ch.done .top span, .lb-ch.done .foot .xp { color: var(--accent); }

.lb-rec { display: flex; align-items: center; gap: 0; padding: 0 20px; box-shadow: inset 0 0 0 1px var(--line); }
.lb-rec span { flex: 1; }
.lb-rec span, .lb-stats span { display: flex; flex-direction: column; gap: 6px; color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: .2em; line-height: 1; }
.lb-rec b, .lb-stats b { color: var(--fg); font-size: 30px; font-weight: 700; letter-spacing: 0; line-height: .76; }

/* ---------------------------------------------------------------- MASTERY */
#lb-wlist { grid-column: 1; display: flex; flex-direction: column; gap: 3px; min-height: 0; }
#loadout .lb-w { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; flex: 1 1 0; min-height: 0; max-height: 50px;
  padding: 0 12px 0 32px; background: var(--fill); color: var(--dim); text-align: left; transition: background .12s, color .12s; }
#loadout .lb-w::before { content: ''; position: absolute; left: 13px; top: 50%; margin-top: -4px; width: 7px; height: 7px; box-shadow: inset 0 0 0 1px var(--faint); transition: background .12s, box-shadow .12s; }
#loadout .lb-w:hover { background: rgba(242,244,245,.09); color: var(--fg); }
#loadout .lb-w.on { background: rgba(242,244,245,.13); color: var(--fg); }
#loadout .lb-w.on::before { background: var(--accent); box-shadow: none; }
.lb-w b { font: 800 20px/1 var(--display); letter-spacing: .07em; padding-top: 2px; }
.lb-w .lb-ico { width: 16px; height: 16px; color: var(--fg); }
.lb-w .lb-ico.none { visibility: hidden; }
.lb-w .lb-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(242,244,245,.06); }
.lb-w .lb-bar i { background: rgba(242,244,245,.55); }
.lb-w.on .lb-bar i { background: var(--fg); }

#lb-mmain { grid-column: 2; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#lb-mhead { display: flex; align-items: flex-end; justify-content: space-between; height: 40px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
#lb-mhead b { font: 800 30px/1 var(--display); letter-spacing: .05em; }
#lb-mhead span { font-size: 13px; font-weight: 600; letter-spacing: .2em; margin-right: -.12em; color: var(--dim); line-height: 1; padding-bottom: 3px; }
#lb-mpv { flex: 1; min-height: 0; position: relative; }
#lb-mpv #lo-preview { position: absolute; inset: 0; }
.lb-stats { display: flex; justify-content: center; gap: 40px; padding-top: 6px; }
.lb-stats span { align-items: center; }

#lb-mside { grid-column: 3; display: flex; flex-direction: column; min-height: 0; padding-top: 2px; }
.lb-tier { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; align-items: start; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.lb-tier > .lb-ico { width: 48px; height: 48px; margin-top: -15px; color: var(--fg); }   /* centred on the title */
.lb-tier > .lb-ico.none { visibility: visible; color: rgba(242,244,245,.14); }
.lb-tier .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; line-height: 1; }
.lb-tier .top b { font: 800 24px/.8 var(--display); letter-spacing: .08em; }
.lb-tier .foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; font-weight: 600; letter-spacing: .16em; color: var(--faint); line-height: 1; }
.lb-tier .top span { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--dim); }
.lb-tier .top span em { font-style: normal; color: var(--fg); }

/* ---------------------------------------------------------------- SUMMARY */
#lb-sres { grid-column: 1; display: flex; flex-direction: column; min-height: 0; }
#lb-sres .what { font-size: 13px; font-weight: 600; letter-spacing: .2em; color: var(--dim); line-height: 1; }
#lb-sres .round { display: flex; align-items: flex-end; gap: 12px; margin: 18px 0 16px; }
#lb-sres .round b { font: 800 96px/.74 var(--display); letter-spacing: .02em; }
#lb-sres .round span { font-size: 13px; font-weight: 600; letter-spacing: .2em; color: var(--dim); line-height: 1; padding-bottom: 2px; }
#lb-sres .where { font-size: 13px; font-weight: 600; letter-spacing: .16em; color: var(--faint); line-height: 1.5; }
#lb-sres .lb-stats { flex-direction: column; justify-content: flex-start; gap: 22px; margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
#lb-sres .lb-stats span { align-items: flex-start; }

#lb-sxp { grid-column: 2; display: flex; flex-direction: column; min-height: 0; max-width: 560px; }
#lb-sxp .total { display: flex; align-items: baseline; gap: 12px; }
#lb-sxp .total b { font: 800 72px/.8 var(--display); letter-spacing: .02em; }
#lb-sxp .total span { font-size: 18px; font-weight: 600; letter-spacing: .2em; color: var(--dim); }
#lb-sxp .void { margin-left: auto; align-self: center; }
.lb-lines { display: flex; flex-direction: column; margin-top: 34px; border-top: 1px solid var(--line); }
.lb-lines div { display: grid; grid-template-columns: 1fr 60px 80px; align-items: baseline; padding: 10px 0 9px; border-bottom: 1px solid rgba(242,244,245,.07); font-size: 15px; font-weight: 600; letter-spacing: .14em; line-height: 1; color: var(--dim);
  opacity: 0; animation: lb-line .3s var(--lb-ease) forwards; }
.lb-lines div span { text-align: right; letter-spacing: .02em; }
.lb-lines div b { text-align: right; color: var(--fg); font-weight: 600; letter-spacing: .02em; }
@keyframes lb-line { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.lb-lvl { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 16px; margin-top: 30px; }
.lb-lvl .lb-emb:last-child { color: var(--faint); }
.lb-lvl .mid { display: flex; flex-direction: column; gap: 9px; }
.lb-lvl .mid .row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: .14em; line-height: 1; color: var(--dim); }
.lb-lvl .mid .row b { color: var(--fg); font-weight: 600; }
.lb-lvl .lb-bar { height: 6px; }
.lb-lvl .lb-bar i { transition-duration: .9s; }
.lb-up { font-style: normal; font-size: 12px; font-weight: 600; letter-spacing: .2em; margin-right: -.2em; line-height: 1; padding: 5px 7px 4px 8px; color: var(--ink); background: var(--accent); }
.lb-up.dim { color: var(--accent); background: none; box-shadow: inset 0 0 0 1px rgba(255,176,0,.55); }

#lb-sside { grid-column: 3; display: flex; flex-direction: column; gap: 0; min-height: 0; }
.lb-sm { display: flex; flex-direction: column; gap: 16px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.lb-sw { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; align-items: baseline; }
.lb-sw b { font: 800 20px/1 var(--display); letter-spacing: .07em; display: flex; align-items: center; gap: 9px; }
.lb-sw b .lb-ico { width: 15px; height: 15px; }
.lb-sw > span { font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--dim); }
.lb-sw .lb-bar { grid-column: 1 / -1; }
.lb-sw .done { grid-column: 1 / -1; font-size: 12px; font-weight: 600; letter-spacing: .16em; color: var(--accent); line-height: 1.4; }
.lb-sw .lb-bar i { transition-duration: .9s; }

/* ---------------------------------------------------------------- footer: the queue */
#loadout.lobby #lo-foot { gap: 28px; }
#lb-queue { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; height: 52px; }
#lb-queue b { font: 800 22px/.8 var(--display); letter-spacing: .07em; white-space: nowrap; }
#lb-queue span { font-size: 13px; font-weight: 600; letter-spacing: .2em; color: var(--dim); line-height: 1; white-space: nowrap; }
#lb-queue span em { font-style: normal; color: var(--accent); }
#loadout .lb-btn { font-size: 15px; font-weight: 600; letter-spacing: .2em; color: var(--dim); padding: 8px 14px 7px; box-shadow: inset 0 0 0 1px var(--line); transition: color .12s, box-shadow .12s; white-space: nowrap; }
#loadout .lb-btn:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--faint); }
#loadout .lb-btn[hidden] { display: none; }
#loadout.lobby .keys { margin-left: auto; }
/* searching / loading: a bar runs along DEPLOY's bottom edge, where the boot loading bar sits */
#loadout #lo-go { position: relative; overflow: hidden; }
#loadout #lo-go::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 34%; background: var(--accent); opacity: 0; }
#loadout.busy #lo-go::after { opacity: 1; animation: lb-run 1.1s cubic-bezier(.45, 0, .55, 1) infinite; }
#loadout.busy #lo-go { background: rgba(242,244,245,.88); }
@keyframes lb-run { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
#loadout.lobby.paused #lo-restart { display: block; }

/* settings as a page under the header: its own heading and BACK give way to the header */
#loadout.lobby #settings { position: static; grid-row: 2; grid-column: 1 / -1; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; min-height: 0; }
#loadout.lobby .set-head h2, #loadout.lobby .set-foot { display: none; }
#loadout.lobby .set-head { gap: 26px; }
#loadout.lobby[data-page="settings"] :is(#lo-classes, #lo-main, #lo-side) { display: none; }

@media (prefers-reduced-motion: reduce) {
  #loadout.lobby .lb-page, #loadout.lobby #settings.show, #loadout.lobby[data-page="loadout"] :is(#lo-classes, #lo-main, #lo-side), .lb-lines div { animation: none; opacity: 1; }
  #loadout.busy #lo-go::after { animation-duration: 3s; }
  .lb-bar i, .lb-card .art, .lb-card::after { transition-duration: .01s !important; }
}

#loadout.lobby #lo-restart { padding: 8px 14px 7px; }
#loadout.lobby .set-row { grid-template-columns: 250px 1fr; }
.lb-ico.none { visibility: hidden; }
#loadout.lobby[data-page="summary"] #lb-level { visibility: hidden; }
/* snd: five cards (the estate has two modes): the two big ones as before, three along the bottom row */
#lb-cards { grid-template-columns: repeat(6, 1fr); }
#lb-cards .lb-card { grid-column: span 2; }
#lb-cards .lb-card:nth-child(-n+2) { grid-column: span 3; }
#lb-cards .lb-card:nth-child(n+3) .name { font-size: 34px; bottom: 15px; }
