/* Terminus loot simulator (/terminus/loot/). Public page: the site header and footer, Inter, Terminus's own palette.
   Tier colors are the Terminus page's (terminus.css): common, uncommon, rare, elite. */
.ls {
  --bg: #0b0d0b; --panel: #151915; --panel-2: #1c211b; --line: rgba(233, 239, 230, 0.1); --line-2: rgba(233, 239, 230, 0.18);
  --text: #e9efe6; --muted: rgba(233, 239, 230, 0.66); --accent: #ffcf4d; --rust: #c8642a; --toxic: #a1e68e;
  --t-common: 233, 239, 230; --t-uncommon: 127, 214, 255; --t-rare: 196, 139, 255; --t-elite: 255, 207, 77;
  /* slot size: --s, set per layout below so the grids grow with the window (owner 2026-11-06: use the whole browser width);
     the recycler's slots are 84 percent of it */
  --s: 72px; --slot: var(--s); --rs: calc(var(--s) * 0.84); --gap: 6px;
  background: var(--bg); color: var(--text); font-family: "Inter", system-ui, sans-serif; overflow-x: clip;
}
.ls *, .ls *::before, .ls *::after { box-sizing: border-box; }
.ls-wrap { width: calc(100% - 32px); margin: 0 auto; position: relative; }
.ls-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ================================================================= app ===== */
/* no hero (owner 2026-11-06): the game starts right under the site header */
.ls { padding-top: 16px; padding-bottom: 24px; }
/* the visit's counters, small readouts on the stage frame */
.ls-readout { position: absolute; z-index: 5; left: 12px; top: 10px; display: flex; gap: 6px; margin: 0; pointer-events: none; }
.ls-readout div { display: flex; align-items: baseline; gap: 5px; padding: 3px 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(233, 239, 230, 0.12); }
.ls-readout dt { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ls-readout dd { margin: 0; font-size: 0.86rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--text); }
/* layout (owner 2026-11-07, the game screen): desktop is one screen with no page scroll (see "game screen" below);
   phones use the tabs */
.ls-app { position: relative; display: grid; gap: 1rem; align-items: start; padding-bottom: 1rem; }
.ls-rail-pane { grid-area: pick; } .ls-open-pane { grid-area: open; } .ls-inv-pane { grid-area: inv; } .ls-rec-pane { grid-area: rec; }
.ls-pane { position: relative; border-radius: 18px; padding: 1rem 1.2rem 1.2rem; min-width: 0;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
/* the inventory's "Empty it" sits in a slim row right above its grid (owner 2026-11-06: no plaque, a plain heading) */
.ls-inv-bar { display: flex; justify-content: flex-end; margin: -0.35rem 0 0.4rem; }
.ls-inv-bar .ls-btn { min-height: 30px; padding: 0.2rem 0.7rem; }
.ls-pane-head.is-over { outline: 2px dashed var(--accent); outline-offset: 3px; border-radius: 8px; }
.ls-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.8rem; }
.ls-pane h2, .ls-open-head h2 { margin: 0; font-size: 1rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.ls-tabs, .ls-down { display: none; }
.ls-app.is-down > :not(.ls-down) { display: none; }
.ls-app.is-down .ls-down, .ls-down.is-on { display: block; padding: 2rem; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* ---------------------------------------------------------------- rail --- */
.ls-rail-pane { position: sticky; top: 84px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.ls-rail { overflow-y: auto; margin: 0 -0.5rem; padding: 0 0.5rem; scrollbar-width: thin; scrollbar-color: rgba(233, 239, 230, 0.25) transparent; }
.ls-group + .ls-group { margin-top: 0.9rem; }
.ls-group h3 { margin: 0 0 0.4rem; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.ls-pick { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.4rem 0.55rem; margin-bottom: 0.3rem; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 0.92rem; font-weight: 700; color: var(--text); text-align: left; background: transparent; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.ls-pick:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--line); transform: translateX(2px); }
.ls-pick.is-on { background: linear-gradient(90deg, rgba(200, 100, 42, 0.22), rgba(200, 100, 42, 0.04)); border-color: rgba(200, 100, 42, 0.55); box-shadow: inset 3px 0 0 var(--rust); }
.ls-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ls-pick-art { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.08), transparent 70%); }
.ls-pick-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6)); }
.ls-pick-art img.is-missing { display: none; }
.ls-pick.is-drawn .ls-pick-art::before { content: ""; width: 30px; height: 22px; border-radius: 4px; background: linear-gradient(180deg, #6d6a5f, #3e3c35); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.4); }
.ls-pick.is-drawn[data-fam="barrel"] .ls-pick-art::before { width: 22px; height: 30px; border-radius: 6px; background: linear-gradient(90deg, #6b3a24, #a8552e 45%, #6b3a24); }
.ls-pick.is-drawn[data-fam="scientist"] .ls-pick-art::before { width: 22px; height: 30px; border-radius: 11px 11px 4px 4px; background: linear-gradient(180deg, #2f6aa3, #1d3e60); }

/* ---------------------------------------------------------------- open --- */
.ls-open-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ls-open-head h2 { font-size: 1.5rem; letter-spacing: 0.06em; }
.ls-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.ls-chip { padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.ls-chip.is-scrap { color: #f3c38f; border-color: rgba(200, 100, 42, 0.45); }
.ls-sound { display: inline-flex; align-items: center; gap: 0.45rem; flex: none; padding: 0.45rem 0.8rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 700;
  color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.ls-sound svg { width: 18px; height: 18px; }
.ls-sound[aria-pressed="false"] svg path:not(:first-child) { opacity: 0.25; }
.ls-sound[aria-pressed="true"] { color: var(--accent); border-color: rgba(255, 207, 77, 0.5); }
.ls-sound:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ls-stage { --best: 233, 239, 230; position: relative; height: 340px; margin: 1rem -1.2rem 0; overflow: hidden; isolation: isolate;
  display: grid; place-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse 70% 80% at 50% 105%, rgba(200, 100, 42, 0.22), transparent 70%), radial-gradient(ellipse 90% 70% at 50% 0%, rgba(161, 230, 142, 0.06), transparent 70%), #0d100d; }
.ls-stage-glow { position: absolute; left: 50%; top: 52%; width: 420px; height: 420px; translate: -50% -50%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(var(--best), 0.18), rgba(var(--best), 0.04) 45%, transparent 70%); animation: ls-breathe 5s ease-in-out infinite; transition: background 0.6s; }
.ls-stage-floor { position: absolute; left: 50%; bottom: 46px; width: 300px; height: 40px; translate: -50% 0; border-radius: 50%; z-index: -1;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.8), transparent 70%); }
@keyframes ls-breathe { 50% { transform: scale(1.12); opacity: 0.75; } }
.ls-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.ls-flash { position: absolute; left: 50%; top: 52%; width: 40px; height: 40px; translate: -50% -50%; border-radius: 50%; pointer-events: none; z-index: 3; opacity: 0; }
.ls-flash.is-on { animation: ls-ring 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.ls-flash.tier-common { --c: var(--t-common); } .ls-flash.tier-uncommon { --c: var(--t-uncommon); } .ls-flash.tier-rare { --c: var(--t-rare); } .ls-flash.tier-elite { --c: var(--t-elite); }
.ls-flash.is-on { box-shadow: 0 0 0 3px rgba(var(--c), 0.9), 0 0 40px 10px rgba(var(--c), 0.6), inset 0 0 30px rgba(var(--c), 0.6); background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(var(--c), 0.5) 40%, transparent 70%); }
.ls-flash.tier-elite.is-on { animation-duration: 1.3s; }
@keyframes ls-ring { 0% { opacity: 1; transform: scale(0.3); } 60% { opacity: 0.7; } 100% { opacity: 0; transform: scale(9); } }
.ls-crate { position: relative; z-index: 1; width: 230px; height: 230px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center;
  animation: ls-float 4.5s ease-in-out infinite; transform-origin: 50% 90%; }
.ls-crate img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 22px 24px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 30px rgba(var(--best), 0.12)); transition: filter 0.4s; pointer-events: none; user-select: none; }
.ls-crate img.is-missing, .ls-crate:not(.is-drawn) .ls-crate-shape { display: none; }
.ls-crate-shape { width: 170px; height: 120px; border-radius: 10px; background: linear-gradient(180deg, #77735f, #47443a 55%, #34322b); box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.35), inset 0 -18px 0 rgba(0, 0, 0, 0.25), 0 24px 30px rgba(0, 0, 0, 0.6); }
.ls-crate[data-fam="barrel"] .ls-crate-shape { width: 110px; height: 160px; border-radius: 16px; background: repeating-linear-gradient(180deg, transparent 0 46px, rgba(0, 0, 0, 0.35) 46px 52px), linear-gradient(90deg, #5e301c, #b55f33 45%, #5e301c); }
.ls-crate[data-fam="elite"] .ls-crate-shape { background: linear-gradient(180deg, #4a4f57, #2c3036); box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.35), 0 0 30px rgba(255, 207, 77, 0.25); }
.ls-crate[data-fam="scientist"] .ls-crate-shape { width: 120px; height: 170px; border-radius: 60px 60px 18px 18px; background: linear-gradient(180deg, #3c7bbd, #1d3e60); }
.ls-crate:hover img { filter: drop-shadow(0 22px 24px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 40px rgba(var(--best), 0.3)); }
.ls-crate:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 16px; }
.ls-crate.is-hit { animation: ls-hit 0.34s cubic-bezier(0.3, 0, 0.3, 1); }
@keyframes ls-float { 50% { transform: translateY(-8px) rotate(-0.6deg); } }
@keyframes ls-hit { 0% { transform: scale(1); } 20% { transform: scale(0.94, 1.04) rotate(-2deg); } 45% { transform: scale(1.06, 0.95) rotate(2deg); } 70% { transform: scale(0.98) rotate(-1deg); } 100% { transform: scale(1); } }
/* opened: the same icon, dimmed, lowered and tipped a little, still lit from behind by the best find's color */
.ls-crate img { transition: filter 0.45s ease, transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1); }
.ls-stage.is-opened .ls-crate img { transform: translateY(10px) rotate(-6deg) scale(0.94);
  filter: brightness(0.5) saturate(0.6) drop-shadow(0 18px 20px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 40px rgba(var(--best), 0.4)); }
.ls-open-btn { position: absolute; z-index: 4; bottom: 18px; left: 50%; translate: -50% 0; min-width: 190px; }

/* ---------------------------------------------------------------- buttons */
.ls-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 42px; padding: 0.55rem 1.2rem; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 0.92rem; font-weight: 800; letter-spacing: 0.04em; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); transition: transform 0.12s, filter 0.15s, background 0.15s; }
.ls-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.ls-btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.ls-btn:disabled { opacity: 0.45; cursor: default; }
.ls-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ls-btn.is-primary { color: #1b1005; text-transform: uppercase; letter-spacing: 0.1em; border-color: rgba(255, 207, 77, 0.8);
  background: linear-gradient(180deg, #ffdf86, #f0a93c 55%, #c8642a); box-shadow: 0 10px 26px rgba(200, 100, 42, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.ls-btn.is-primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(180deg, #ffe598, #f4b24a 55%, #d06f33); }
.ls-btn.is-small { min-height: 34px; padding: 0.35rem 0.8rem; font-size: 0.8rem; border-radius: 10px; }
.ls-btn.is-ghost { background: transparent; }

/* ---------------------------------------------------------------- grids -- */
.ls-loot-head { display: flex; align-items: center; gap: 0.8rem; margin: 1rem 0 0.6rem; }
.ls-loot-head h3 { margin: 0; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.ls-total { flex: 1; margin: 0; font-size: 0.92rem; color: var(--muted); }
.ls-total b { color: var(--text); font-variant-numeric: tabular-nums; }
.ls-grid { display: grid; grid-template-columns: repeat(6, var(--slot)); gap: var(--gap); justify-content: start; }
.ls-grid.is-loot { grid-template-columns: repeat(6, var(--slot)); min-height: calc(var(--slot) + 2px); }
.ls-grid.is-inv .ls-slot.is-belt:nth-child(25) { grid-column: 1; }
.ls-grid.is-inv .ls-slot:nth-child(25) { margin-top: 10px; }
.ls-grid.is-inv .ls-slot.is-belt { margin-top: 10px; }
.ls-hint { margin: 0.8rem 0 0; font-size: 0.82rem; color: var(--muted); }

.ls-slot { --c: var(--t-common); position: relative; width: var(--slot); height: var(--slot); border-radius: 8px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.2)), #232823; border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55), inset 0 -1px 0 rgba(255, 255, 255, 0.04); }
.ls-slot.is-belt { background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.15)), #262b22; }
.ls-slot.has-item { cursor: grab; touch-action: none; outline: none; }
.ls-slot.has-item:focus-visible { box-shadow: 0 0 0 2px var(--accent), inset 0 2px 6px rgba(0, 0, 0, 0.55); }
.ls-slot.tier-uncommon { --c: var(--t-uncommon); } .ls-slot.tier-rare { --c: var(--t-rare); } .ls-slot.tier-elite { --c: var(--t-elite); }
.ls-slot.has-item { background: radial-gradient(ellipse 90% 70% at 50% 110%, rgba(var(--c), 0.22), transparent 70%), linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.12)), #262c26;
  border-color: rgba(var(--c), 0.28); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 -2px 0 rgba(var(--c), 0.55); }
.ls-slot.tier-common.has-item { border-color: rgba(0, 0, 0, 0.55); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 -2px 0 rgba(var(--c), 0.18); }
.ls-slot-glow { position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; }
.ls-slot.tier-rare .ls-slot-glow, .ls-slot.tier-elite .ls-slot-glow { opacity: 1; box-shadow: 0 0 14px rgba(var(--c), 0.45), inset 0 0 12px rgba(var(--c), 0.25); animation: ls-pulse 2.4s ease-in-out infinite; }
.ls-slot.tier-elite .ls-slot-glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, transparent 62%); background-size: 250% 100%; animation: ls-sheen 2.8s ease-in-out infinite; }
@keyframes ls-pulse { 50% { opacity: 0.55; } }
@keyframes ls-sheen { 0% { background-position: 150% 0; } 60%, 100% { background-position: -100% 0; } }
/* the game's own icon fills the slot with a small inset, as in the game (about 84 percent) */
.ls-slot img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)); }
.ls-slot img.is-missing { opacity: 0; }
.ls-amt { position: absolute; right: 5px; bottom: 3px; z-index: 2; font-size: 0.8rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000, 0 0 4px #000; pointer-events: none; }
.ls-amt.is-full { color: #f3d9a6; }
/* condition: a thin bar up the left edge, as in the game */
.ls-cond { position: absolute; left: 3px; top: 12%; bottom: 12%; width: 4px; display: flex; align-items: flex-end; border-radius: 2px; overflow: hidden; pointer-events: none;
  background: rgba(0, 0, 0, 0.6); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.ls-cond i { display: block; width: 100%; border-radius: 2px; background: linear-gradient(180deg, #b6ef7a, #5fae3c); }
.ls-cond.is-low i { background: linear-gradient(180deg, #ff9a6a, #c8452c); }
.ls-badge { position: absolute; top: 3px; left: 3px; display: grid; place-items: center; min-width: 18px; height: 16px; padding: 0 3px; border-radius: 4px; font-size: 0.6rem; font-weight: 900; letter-spacing: 0.04em; pointer-events: none; }
.ls-badge.is-bp { color: #dff2ff; background: #2a64a8; }
.ls-badge.is-skin { left: auto; right: 3px; color: #1b1005; background: var(--accent); }
.ls-badge.is-skin svg { width: 11px; height: 11px; }
.ls-slot.is-bp, .ls-ghost.is-bp { background: linear-gradient(rgba(140, 200, 255, 0.12) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, rgba(140, 200, 255, 0.12) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(180deg, #1f4f86, #163a63); border-color: rgba(127, 214, 255, 0.45); }
.ls-slot.is-deal { animation: ls-deal 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; animation-delay: var(--d, 0ms); }
@keyframes ls-deal { from { opacity: 0; transform: translateY(-40px) scale(0.4) rotate(-12deg); filter: brightness(2.2); } 60% { filter: brightness(1.4); } }
.ls-slot.is-landed { animation: ls-land 0.4s ease-out; }
@keyframes ls-land { 0% { transform: scale(0.82); box-shadow: 0 0 0 2px rgba(var(--c), 0.9), 0 0 18px rgba(var(--c), 0.6); } 100% { transform: scale(1); } }
.ls-slot.is-bounce { animation: ls-bounce 0.35s ease-in-out; }
@keyframes ls-bounce { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.ls-slot.is-lifted { opacity: 0.35; }
.ls-slot.is-over, .ls-grid.is-over, .ls-tabs button.is-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.ls-ghost { --c: var(--t-common); position: fixed; left: 0; top: 0; z-index: 9999; width: 72px; height: 72px; border-radius: 10px; pointer-events: none;
  background: #2a302a; border: 1px solid rgba(var(--c), 0.7); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.6), 0 0 22px rgba(var(--c), 0.45); }
.ls-ghost.tier-uncommon { --c: var(--t-uncommon); } .ls-ghost.tier-rare { --c: var(--t-rare); } .ls-ghost.tier-elite { --c: var(--t-elite); }
.ls-ghost img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
body.ls-dragging, body.ls-dragging * { cursor: grabbing !important; }

/* ------------------------------------------------------------- recycler -- */
.ls-recycler { position: relative; display: grid; gap: 0.7rem; padding: 0.9rem; border-radius: 14px;
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.18) 0 10px, transparent 10px 20px), linear-gradient(180deg, #2b3a2a, #1c261b); border: 1px solid rgba(161, 230, 142, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 10px 30px rgba(0, 0, 0, 0.35); }
.ls-recycler.is-on { border-color: rgba(161, 230, 142, 0.45); }
.ls-rec-row { display: flex; align-items: center; gap: 0.6rem; }
.ls-rec-label { width: 2.2rem; flex: none; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ls-grid.is-rec { --slot: var(--rs); grid-template-columns: repeat(6, var(--slot)); }
.ls-rec-mid { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0.3rem 0.8rem; align-items: center; }
.ls-power { grid-row: 1 / 3; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #b9c4b6;
  background: radial-gradient(circle at 50% 35%, #3a423a, #1a1f1a); border: 2px solid #0b0e0b; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1); transition: color 0.2s, box-shadow 0.2s; }
.ls-power svg { width: 24px; height: 24px; }
.ls-power[aria-pressed="true"] { color: #b6ff9e; box-shadow: 0 0 0 2px rgba(161, 230, 142, 0.6), 0 0 22px rgba(161, 230, 142, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.ls-power:disabled { opacity: 0.45; cursor: default; }
.ls-power:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ls-rec-track { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.ls-rec-bar { display: block; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, #6fc35a, #b6ff9e); box-shadow: 0 0 10px rgba(161, 230, 142, 0.7); }
.ls-rec-state { margin: 0; font-size: 0.8rem; color: var(--muted); }
.ls-recycler [data-ls-rec-take] { justify-self: end; }

/* -------------------------------------------------------------- sheet ---- */
.ls-sheet { position: absolute; z-index: 40; width: 280px; }
.ls-sheet.is-on { animation: ls-pop 0.16s ease-out; }
@keyframes ls-pop { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.ls-sheet-card { --c: var(--t-common); padding: 0.7rem 0.7rem 0.65rem; border-radius: 14px; background: linear-gradient(180deg, #232923, #171b17); border: 1px solid rgba(var(--c), 0.45);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 26px rgba(var(--c), 0.15); }
.ls-sheet-card.tier-uncommon { --c: var(--t-uncommon); } .ls-sheet-card.tier-rare { --c: var(--t-rare); } .ls-sheet-card.tier-elite { --c: var(--t-elite); }
.ls-sheet-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.55rem; }
.ls-sheet-icon { position: relative; flex: none; width: 60px; height: 60px; border-radius: 8px; background: #262c26; }
.ls-sheet-icon.is-bp { background: linear-gradient(180deg, #1f4f86, #163a63); }
.ls-sheet-icon img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.ls-sheet-head b { display: block; font-size: 0.98rem; }
.ls-sheet-head small { display: block; margin-top: 0.15rem; font-size: 0.78rem; color: rgb(var(--c)); }
.ls-sheet-acts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ls-sheet-acts .ls-btn { flex: 1 1 0; min-height: 44px; }

.ls-toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; translate: -50% 0; margin: 0; padding: 0.6rem 1rem; border-radius: 12px; font-size: 0.9rem; font-weight: 700;
  background: #2a2015; border: 1px solid rgba(200, 100, 42, 0.6); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; transform: translateY(8px); }
.ls-toast.is-on { opacity: 1; transform: none; }

/* ============================================================== phone ===== */
@media (max-width: 720px) {
  .ls { --gap: 4px; }
  .ls-inv-bar .ls-btn { min-height: 40px; }
  /* slots of 44 px and more at 375: the panes give the grids almost their full width, the text keeps its inset */
  .ls-pane-head, .ls-open-head, .ls-loot-head { padding-inline: 0.45rem; }
  .ls-recycler { padding: 0.6rem 0.35rem; }
  .ls-rec-row { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .ls-rec-label { width: auto; padding-left: 0.2rem; }
  .ls-recycler [data-ls-rec-take] { margin-right: 0.2rem; }
  /* phone grids take the pane's width: six fluid columns of square slots */
  .ls-grid, .ls-grid.is-loot, .ls-grid.is-inv, .ls-grid.is-rec { grid-template-columns: repeat(6, minmax(0, 1fr)); flex: 1; min-width: 0; }
  .ls-slot { width: auto; height: auto; aspect-ratio: 1 / 1; }
  .ls-rec-label { width: 1.9rem; }
  .ls-app { display: block; padding-bottom: 5.5rem; }
  .ls-pane { display: none; padding: 0.9rem 0.35rem 1rem; }
  .ls-app[data-tab="pick"] .ls-rail-pane, .ls-app[data-tab="open"] .ls-open-pane, .ls-app[data-tab="inv"] .ls-inv-pane, .ls-app[data-tab="rec"] .ls-rec-pane { display: block; }
  .ls-rail { display: block; overflow: visible; margin: 0; padding: 0 0.45rem; }
  .ls-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; gap: 0.35rem; }
  .ls-group + .ls-group { margin-top: 0.9rem; }
  .ls-pick { white-space: normal; min-width: 0; padding: 0.35rem 0.4rem; gap: 0.5rem; }
  .ls-pick-name { min-width: 0; overflow-wrap: anywhere; }
  .ls-pick-art { width: 38px; height: 38px; }
  .ls-open-head h2 { font-size: 1.2rem; }
  .ls-sound span { display: none; }
  .ls-stage { height: 280px; margin: 0.8rem -0.35rem 0; }
  .ls-crate { width: 190px; height: 190px; }
  .ls-recycler { padding: 0.7rem; }
  .ls-amt { font-size: 0.72rem; right: 3px; bottom: 2px; }
  .ls-hint { display: none; }
  .ls-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgba(28, 33, 27, 0.97), rgba(14, 16, 14, 0.98)); border-top: 1px solid var(--line-2); box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); }
  .ls-tabs button { display: grid; justify-items: center; gap: 0.15rem; min-height: 52px; padding: 0.3rem 0; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: 0.7rem; font-weight: 800; cursor: pointer; }
  .ls-tabs button svg { width: 22px; height: 22px; }
  .ls-tabs button.is-on { color: var(--accent); background: rgba(255, 207, 77, 0.08); }
  .ls-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .ls-sheet { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); width: auto; padding: 0 12px; }
  .ls-toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* ===================================================== interface art ====
   Web Visuals' pieces under /images/terminus-loot/. loot-sim.js adds .art-<piece> to the page once a file loads; without
   it the drawn look above stays. */
.ls-rec-machine { display: none; }
.ls-chip.is-wait { color: #f3c38f; border-color: rgba(200, 100, 42, 0.45); }
.ls-pick.is-wait .ls-pick-name::after { content: "Soon"; margin-left: 0.45rem; padding: 0.05rem 0.4rem; border-radius: 999px; font-size: 0.66rem; font-weight: 800; color: #f3c38f; border: 1px solid rgba(200, 100, 42, 0.45); }

/* the page backdrop: a dark salvage yard behind the hero and the app, fading into the page */
.ls.art-backdrop { position: relative; isolation: isolate; }
.ls.art-backdrop::before { content: ""; position: absolute; inset: 0 0 auto; height: min(1500px, 140vh); z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 13, 11, 0.25), rgba(11, 13, 11, 0.55) 45%, var(--bg) 100%), url("/images/terminus-loot/backdrop.webp") 30% top / cover no-repeat; }
.ls.art-backdrop .ls-pane { background: linear-gradient(180deg, rgba(28, 33, 27, 0.86), rgba(18, 21, 18, 0.92)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* the steel frame around the grids (9-slice, slice 48, open center) */
.ls.art-frame { --fw: 40px; }
.ls.art-frame .ls-grid.is-loot, .ls.art-frame .ls-grid.is-inv { width: max-content; padding: 6px; border: 14px solid transparent; border-image: url("/images/terminus-loot/inventory-frame.webp") 48 / 14px stretch; }
.ls.art-frame .ls-grid.is-loot { margin-inline: auto; }

/* the empty slot well */
.ls.art-slot .ls-slot { border: 0; border-radius: 16%; box-shadow: none; background: url("/images/terminus-loot/slot.webp") center / 100% 100% no-repeat; }
.ls.art-slot .ls-slot.has-item { background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(var(--c), 0.32), transparent 70%), url("/images/terminus-loot/slot.webp") center / 100% 100% no-repeat; box-shadow: inset 0 -3px 0 -1px rgba(var(--c), 0.6); }
.ls.art-slot .ls-slot.tier-common.has-item { box-shadow: none; }
.ls.art-slot .ls-slot.is-bp { background: linear-gradient(rgba(140, 200, 255, 0.16) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, rgba(140, 200, 255, 0.16) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(180deg, rgba(31, 79, 134, 0.85), rgba(22, 58, 99, 0.85)), url("/images/terminus-loot/slot.webp") center / 100% 100%; }
.ls.art-slot .ls-slot.is-belt { filter: brightness(1.08) sepia(0.12); }


/* the brass Open button: three faces, the label on the glass */
.ls.art-roll .ls-stage { height: 400px; }
.ls.art-roll .ls-crate { margin-bottom: 96px; }
.ls.art-roll .ls-open-btn { bottom: 6px; width: 220px; min-width: 0; height: auto; aspect-ratio: 900 / 518; padding: 0 0 2px; border: 0; border-radius: 0; box-shadow: none; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6));
  background: url("/images/terminus-loot/roll-button.webp") center / 100% 100% no-repeat; color: #3a1d04; font-size: 0.86rem; letter-spacing: 0.08em; white-space: nowrap; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.7); }
.ls.art-roll .ls-open-btn:hover:not(:disabled) { background: url("/images/terminus-loot/roll-button-hot.webp") center / 100% 100% no-repeat; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 22px rgba(255, 190, 70, 0.45)); }
.ls.art-roll .ls-open-btn:active:not(:disabled) { background: url("/images/terminus-loot/roll-button-pressed.webp") center / 100% 100% no-repeat; transform: translateY(2px); }
.ls.art-roll .ls-open-btn:disabled { opacity: 1; filter: grayscale(0.7) brightness(0.62) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6)); }
.ls.art-roll .ls-open-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -14px; }

/* the recycler itself, idle or grinding */
/* the machine row: the recycler art in the middle and the speed toggle in the free space to its right (owner 2026-11-06) */
.ls-rec-stage { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.ls-rec-stage .ls-speed { grid-column: 3; justify-self: start; margin-left: 0.6rem; min-width: 52px; }
.ls.art-machine .ls-rec-machine { display: block; position: relative; grid-column: 2; width: calc(var(--s) * 2.6); aspect-ratio: 1; margin: -0.6rem 0 -1rem; }
.ls-rec-machine img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.6)); user-select: none; pointer-events: none; }
.ls-rec-machine.is-drawn { display: none !important; }
/* spin: while it runs the machine shakes like a washing machine on spin, small and fast, then settles (owner 2026-11-06) */
.ls-recycler.is-on .ls-rec-machine img { animation: ls-spin 0.3s linear infinite; }
@keyframes ls-spin {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(1.4px, -0.8px) rotate(0.35deg); }
  50% { transform: translate(-1px, 1.2px) rotate(-0.3deg); }
  75% { transform: translate(-1.5px, -0.6px) rotate(0.25deg); }
}
.ls-rec-machine.is-over { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: 16px; }

@media (max-width: 720px) {
  .ls.art-frame .ls-grid.is-loot, .ls.art-frame .ls-grid.is-inv { width: auto; padding: 3px; border-width: 8px; border-image-width: 8px; }
  .ls.art-roll .ls-stage { height: 330px; }
  .ls.art-roll .ls-crate { margin-bottom: 84px; }
  .ls.art-roll .ls-open-btn { width: 196px; font-size: 0.76rem; letter-spacing: 0.05em; }
  .ls.art-machine .ls-rec-machine { width: 150px; }
}


/* ========================================================= game screen ====
   Desktop (721 px and up): the whole game in one screen below the site header, no page scroll; the site footer is hidden on
   this page. loot-sim.js "fit" picks the slot sizes (--s loot, --is inventory, --rs recycler) and the app height (--ls-h). */
    /* phones: the counters stay off the title bar */
    @media (max-width: 720px) { .ls-titlebar .ls-readout { display: none; } }
    @media (min-width: 721px) {
      .site-footer { display: none; }
      .ls.art-backdrop::before { height: 100%; }
      .ls { padding: 8px 0 0; --gap: 5px; }
      .ls .ls-wrap { width: calc(100% - 16px); }
      .ls .ls-app { height: var(--ls-h, auto); gap: 8px; padding: 0; align-items: stretch; }
      .ls .ls-pane { padding: 7px 9px 9px; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
      .ls .ls-pane-head, .ls .ls-titlebar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; min-height: 28px; flex: none; }
      .ls .ls-pane h2, .ls .ls-open-head h2 { font-size: 0.74rem; letter-spacing: 0.14em; margin: 0; white-space: nowrap; }
      .ls .ls-open-head h2 { font-size: 0.92rem; letter-spacing: 0.08em; }
      .ls .ls-open-head { justify-content: flex-start; }
      .ls .ls-meta { margin: 0; flex-wrap: nowrap; overflow: hidden; min-width: 0; flex: 1; }
      .ls .ls-chip { font-size: 0.66rem; padding: 0.1rem 0.45rem; white-space: nowrap; }
      .ls .ls-titlebar .ls-readout { position: static; display: flex; gap: 4px; margin: 0; flex: none; }
      .ls .ls-titlebar .ls-readout div { padding: 2px 6px; }
      .ls .ls-titlebar .ls-readout dt { font-size: 0.56rem; } .ls .ls-titlebar .ls-readout dd { font-size: 0.78rem; }
      .ls .ls-sound { padding: 0.3rem 0.55rem; flex: none; } .ls .ls-sound span { display: none; }
      .ls .ls-pane-head .ls-btn, .ls .ls-loot-head .ls-btn { min-height: 26px; padding: 0.15rem 0.6rem; font-size: 0.72rem; margin-left: auto; }
      .ls .ls-rec-state { margin: 0; font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
      .ls .ls-loot-head { margin: 6px 0 5px; flex: none; }
      .ls .ls-total { font-size: 0.78rem; }
      .ls .ls-hint { display: none; }
      /* the stage: the container and the Open button side by side, taking whatever height the loot grid leaves */
      .ls .ls-stage { flex: 1 1 auto; height: auto; min-height: calc(var(--s) * 1.7); margin: 0; border: 1px solid var(--line); border-radius: 10px;
        display: flex; align-items: center; justify-content: center; gap: clamp(12px, 3vw, 40px); }
      .ls .ls-stage-floor { display: none; }
      .ls .ls-crate { width: calc(var(--s) * 1.6); height: calc(var(--s) * 1.6); margin: 0; }
      .ls .ls-open-btn { position: static; translate: none; flex: none; }
      .ls.art-roll .ls-open-btn { width: clamp(150px, calc(var(--s) * 2.3), 210px); }
      /* frames and grids, a little tighter than the live page */
      .ls.art-frame .ls-grid.is-loot, .ls.art-frame .ls-grid.is-inv { padding: 3px; border-width: 10px; border-image-width: 10px; width: max-content; margin-inline: 0; }
      .ls .ls-grid.is-inv .ls-slot.is-belt { margin-top: 6px; }
      .ls .ls-grid.is-loot { flex: none; align-self: center; }
      .ls.is-fitting .ls-grid.is-loot { min-height: calc(var(--s) * 5 + var(--gap) * 4 + 26px); }
      .ls .ls-grid.is-inv { align-self: center; --slot: var(--is, var(--s)); }
      .ls .ls-recycler { padding: 7px; border-radius: 10px; }
      .ls .ls-rec-label { font-size: 0.6rem; width: auto; }
      .ls .ls-power { width: 40px; height: 40px; }
      .ls .ls-power svg { width: 20px; height: 20px; }
      .ls .ls-speed { min-height: 30px; min-width: 40px; padding: 0.1rem 0.5rem; }
      .ls.art-machine .ls-rec-machine { width: calc(var(--rs) * 1.7); margin: 0; }
      .ls .ls-rec-ctrl { display: flex; align-items: center; gap: 8px; }
      .ls .ls-rec-track { height: 6px; }
      /* the container rail */
      .ls .ls-rail-pane { position: static; max-height: none; }
      .ls .ls-pick { padding: 4px; }
      .ls .ls-pick-art { width: 42px; height: 42px; }
    }

    @media (min-width: 721px) {
      /* the game screen (owner 2026-11-07): icon rail | stage and loot | inventory over a recycler strip */
      .ls { --rs: calc(var(--s) * 0.72); }
      .ls .ls-app { grid-template-columns: 62px minmax(0, 1fr) auto; grid-template-areas: "pick open side"; grid-template-rows: minmax(0, 1fr); }
      .ls .ls-side { grid-area: side; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
      .ls .ls-side .ls-inv-pane { flex: none; }
      .ls .ls-side .ls-rec-pane { flex: 1 1 auto; }
      .ls .ls-rail-pane { padding: 6px 4px; overflow-y: auto; }
      .ls .ls-rail-pane .ls-pane-head, .ls .ls-group h3, .ls .ls-pick-name { display: none; }
      .ls .ls-rail { margin: 0; padding: 0; overflow: visible; display: block; }
      .ls .ls-group { display: grid; grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); gap: 1px; } .ls .ls-group + .ls-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
      .ls .ls-pick { padding: 2px; } .ls .ls-pick-art { width: min(40px, calc(var(--ls-h, 800px) / 16 - 9px)); height: min(40px, calc(var(--ls-h, 800px) / 16 - 9px)); }
      .ls .ls-pick { justify-content: center; margin: 0; width: 100%; }
      .ls .ls-pick:hover { transform: none; }
      .ls .ls-pick.is-on { box-shadow: inset 0 0 0 2px var(--rust); }
      .ls .ls-rec-strip { display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "lin gin mach" "lout gout mach" "track track track"; gap: 5px 8px; align-items: center; flex: 1; align-content: center; }
      .ls .ls-rec-lin { grid-area: lin; } .ls .ls-rec-gin { grid-area: gin; } .ls .ls-rec-lout { grid-area: lout; } .ls .ls-rec-gout { grid-area: gout; }
      .ls .ls-rec-mach { grid-area: mach; display: flex; flex-direction: column; align-items: center; gap: 6px; }
      .ls .ls-rec-trackrow { grid-area: track; }
      .ls.art-machine .ls-rec-machine { width: calc(var(--rs) * 1.5); }
    }

@media (prefers-reduced-motion: reduce) {
  .ls-stage-glow, .ls-crate, .ls-slot-glow, .ls-slot-glow::before, .ls-recycler.is-on .ls-rec-machine img { animation: none !important; }
  .ls-flash.is-on { animation-duration: 0.01s; }
}
