/* Loot filter builder -- scoped page styles. Uses the site tokens (site.css :root), same vocabulary as reborn.css. */
.lf.wrap { max-width: 1280px; }
.lf-hero { padding: var(--s10) 0 var(--s5); max-width: 780px; }
.lf-hero h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; margin: 0 0 var(--s4); }
.lf-hero p { color: var(--tx-mid); margin: 0 0 var(--s3); }
.lf-hero .lede { color: var(--tx-hi); font-size: 17px; }
.lf-hero a { color: var(--accent); }

.lf-l, .lf-k { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--tx-lo); }
.lf-start { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s6); }

.lf-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s6); align-items: start; margin-bottom: var(--s12); }
@media (max-width: 980px) { .lf-grid { grid-template-columns: minmax(0, 1fr); } }
.lf-side { display: flex; flex-direction: column; gap: var(--s5); position: sticky; top: var(--s4); }
@media (max-width: 980px) { .lf-side { position: static; } }

.lf-sh { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.lf-sh h2 { margin: 0; font-size: 18px; }
.lf-sh .muted { font-size: 13px; }

.lf-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lf-chip {
  appearance: none; cursor: pointer; padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--tx-mid); font: 600 12.5px var(--sans); transition: .12s;
}
.lf-chip:hover { color: var(--tx-hi); border-color: var(--accent-line); }
.lf-chip.on { background: var(--accent-bg-2); border-color: var(--accent-line); color: var(--accent-2); }
.lf-chip-alt { border-style: dashed; }
.lf-chip:focus-visible, .lf-seg button:focus-visible, .lf-tool:focus-visible { outline: none; box-shadow: var(--focus); }

.lf-list { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.lf-empty { color: var(--tx-lo); font-style: italic; padding: var(--s4); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.lf-rule {
  background: var(--bg-1); border: 1px solid var(--line); border-left: 3px solid var(--ok);
  border-radius: var(--r-lg); padding: var(--s3) var(--s4) var(--s3); display: flex; flex-direction: column; gap: 10px;
}
.lf-rule.is-hide { border-left-color: var(--tx-lo); }
.lf-rh { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.lf-n { font: 700 13px var(--mono); color: var(--tx-lo); min-width: 18px; }
.lf-note {
  flex: 1 1 160px; min-width: 0; height: 32px; padding: 0 10px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--tx-hi); font: 400 13px var(--sans);
}
.lf-tools { display: flex; gap: 2px; margin-left: auto; }
.lf-tool { appearance: none; cursor: pointer; width: 30px; height: 30px; border-radius: var(--r-md); border: 1px solid transparent;
  background: transparent; color: var(--tx-lo); font: 600 14px var(--sans); }
.lf-tool:hover { color: var(--tx-hi); background: var(--bg-3); }

.lf-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; }
.lf-seg button { appearance: none; cursor: pointer; border: none; background: var(--bg-2); color: var(--tx-mid);
  font: 600 12.5px var(--sans); padding: 6px 12px; }
.lf-seg button + button { border-left: 1px solid var(--line-2); }
.lf-seg button.on { background: var(--accent-bg-2); color: var(--accent-2); }
.lf-rule.is-hide .lf-rh .lf-seg button.on { background: var(--bg-4); color: var(--tx-hi); }

.lf-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: var(--s3); align-items: center; }
@media (max-width: 560px) { .lf-row { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
.lf-nums { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .lf-nums { grid-template-columns: minmax(0, 1fr); } }
.lf-num { display: grid; grid-template-columns: 78px 64px minmax(0, 90px); gap: 6px var(--s2); align-items: center; }
.lf-num .lf-hint { grid-column: 2 / -1; }
.lf-rule select, .lf-rule input[type=number], .lf-additem, .lf-sound, .lf-try input {
  height: 32px; padding: 0 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-2);
  color: var(--tx-hi); font: 500 13px var(--sans); min-width: 0; width: 100%;
}
.lf-additem { width: auto; flex: 1 1 220px; }
.lf-sound { width: 110px; }
.lf-rule select:focus-visible, .lf-rule input:focus-visible, .lf-try input:focus-visible, .lf-note:focus-visible { outline: none; box-shadow: var(--focus); }
.lf-hint { font-size: 12px; color: var(--tx-lo); }
.lf-looks { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); }
.lf-looks .lf-hint { flex-basis: 100%; }
.lf-row > .lf-seg { justify-self: start; }
.lf-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tx-mid); white-space: nowrap; }
.lf-check input[type=color] { width: 34px; height: 26px; padding: 0 2px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); }
.lf-check input[type=color]:disabled { opacity: .35; }
.lf-x { color: var(--accent-2); }
.lf-sum { margin: 2px 0 0; font-size: 13px; color: var(--tx-mid); border-top: 1px solid var(--line); padding-top: 8px; }
.lf-cant { color: var(--tx-lo); font-size: 13px; margin: var(--s4) 0 0; }

.lf-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); }
.lf-acts { display: flex; gap: var(--s2); }
.lf-try { display: flex; align-items: center; gap: var(--s3); font: 600 12px var(--sans); color: var(--tx-lo); margin-bottom: var(--s2); }
.lf-try input { flex: 1; }
.lf-summary { margin: 0 0 var(--s2); font-size: 13px; color: var(--tx-mid); }
/* The names are drawn on a near-black ground in their real label colours, like the floor in game. */
.lf-preview { max-height: 460px; overflow: auto; background: #07080b; border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 10px; }
.lf-pg + .lf-pg { margin-top: 8px; }
.lf-pgh { font: 700 10.5px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--tx-faint); padding: 4px 0 2px; }
.lf-pi { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s3); align-items: baseline; padding: 3px 0; font-size: 13px; }
.lf-pn { font-weight: 500; text-shadow: 0 0 2px #000, 0 0 1px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-pn.emph { font-weight: 700; letter-spacing: .01em; text-shadow: 0 0 1px #000, 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.lf-pm { font-size: 11.5px; color: var(--tx-lo); white-space: nowrap; }
.lf-pt { font: 600 11px var(--mono); color: var(--tx-mid); white-space: nowrap; }
.lf-pi.hid .lf-pn { color: var(--tx-faint); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.18); }
.lf-pi.hid .lf-pt { color: var(--tx-lo); }

.lf-errors { background: var(--crit-bg); border: 1px solid rgba(224,102,74,.4); color: var(--tx-hi); border-radius: var(--r-md);
  padding: 8px 12px; font-size: 13px; margin-bottom: var(--s3); }
.lf-text { margin: 0; max-height: 320px; overflow: auto; background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 12px; font: 12.5px/1.5 var(--mono); color: var(--tx-hi); white-space: pre; }
.lf-how { font-size: 13px; margin: var(--s3) 0 0; }
.lf-how code { font: 12px var(--mono); color: var(--accent-2); }
.lf-rules, .lf-side, .lf-card { min-width: 0; }

/* ---- On the ground: the in-game scene ([spec-ground-label-colors] preview). The picture is a real client frame; the
   labels are placed at the boxes the game itself drew (lootfilter-scene.json) and scale with the picture through one
   unit, --u = one game pixel at the current width, so a label keeps its size and place relative to its item. */
.lf-show { margin-bottom: var(--s8); }
.lf-show .lf-sh .muted { flex: 1 1 320px; }
.lf-ghost { margin-left: auto; }
.lf-scene { container-type: inline-size; position: relative; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: #0b0d09; max-width: 1200px; }   /* not overflow:hidden -- the tooltip may hang past the picture */
.lf-scene-in { position: relative; aspect-ratio: var(--ar, 960 / 428); --u: calc(100cqw / var(--w, 960)); }
.lf-scene-in img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: var(--r-lg); }
.lf-scene.stale .lf-gl, .lf-scene.stale .lf-gm { opacity: .25; }
/* The game's label font is a 1-bit 12px SimSun (ini/Font.ini); its glyph box starts ~2px below the em box's top, so the
   text is lifted by that much to put the glyphs on the measured box. */
.lf-gl { position: absolute; transform: translate(-50%, calc(var(--u) * -2)); white-space: pre; pointer-events: none;
  font: 400 calc(var(--u) * 12) / calc(var(--u) * 12) "SimSun", "NSimSun", "Courier New", monospace;
  -webkit-font-smoothing: none; font-smooth: never; letter-spacing: 0; }
.lf-gl.hid { display: none; }
.lf-scene.ghost .lf-gl.hid { display: block; opacity: .4; text-decoration: line-through; text-decoration-thickness: max(1px, var(--u)); }
.lf-gm { position: absolute; pointer-events: none; font: 700 calc(var(--u) * 10) / 1 var(--sans); color: #ffe7a3;
  text-shadow: 0 0 2px #000, 0 0 2px #000; letter-spacing: .1em; }
.lf-gm.hid { display: none; }
.lf-scene.ghost .lf-gm.hid { display: block; opacity: .4; }
.lf-hot { position: absolute; appearance: none; border: 0; padding: 0; margin: 0; background: transparent; cursor: help; border-radius: 6px; }
.lf-hot:hover, .lf-hot.sel { box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); background: rgba(255,255,255,.06); }
.lf-hot:focus-visible { outline: none; box-shadow: var(--focus); }
/* Pointing at a hidden item reveals its name, as it does in game. */
.lf-hot.hid:hover + .lf-gl.hid, .lf-hot.hid.sel + .lf-gl.hid { display: block; opacity: 1; text-decoration: none; }
.lf-tip { position: absolute; z-index: 3; transform: translate(-50%, 0); width: max-content; max-width: min(300px, 70cqw);
  background: rgba(8,10,14,.94); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); font-size: 12.5px; line-height: 1.45; color: var(--tx-mid); pointer-events: auto; }
.lf-tip.flipx { transform: translate(-100%, 0); }
.lf-tip.flipy { transform: translate(-50%, calc(-100% - 40px)); }
.lf-tip.flipx.flipy { transform: translate(-100%, calc(-100% - 40px)); }
.lf-tip-t { font: 700 13px "SimSun", "NSimSun", "Courier New", monospace; text-shadow: 1px 1px 0 #000; }
.lf-tip-m { color: var(--tx-lo); font-size: 11.5px; }
.lf-tip-v { color: var(--tx-hi); margin-top: 3px; }
.lf-tip-v.hid { color: var(--accent-2); }
.lf-tip-snd { margin-top: 6px; }
/* The showcase: the same items as a list (the readable view on a phone). */
.lf-showcase { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); max-width: 1200px; }
.lf-sc-b { appearance: none; cursor: pointer; width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  background: #07080b; border: 1px solid var(--line); border-radius: var(--r-md); padding: 5px 9px; text-align: left; }
.lf-sc-b:hover, .lf-sc.sel .lf-sc-b { border-color: var(--accent-line); }
.lf-sc-b:focus-visible { outline: none; box-shadow: var(--focus); }
.lf-sc-n { font: 13px "SimSun", "NSimSun", "Courier New", monospace; text-shadow: 1px 1px 0 #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lf-sc-n.emph { text-shadow: 1px 0 0 currentColor, 1px 1px 0 #000, -1px 0 0 #000, 0 -1px 0 #000, 2px 1px 0 #000; }
.lf-sc-r { font: 600 11px var(--mono); color: var(--tx-lo); white-space: nowrap; }
.lf-sc.hid .lf-sc-n { color: var(--tx-faint); text-decoration: line-through; }
/* A phone: the picture stays (it shows what is lying there), the labels would be a few pixels tall -- so each item is a
   coloured dot (hollow = hidden) and the list below carries the names. */
@container (max-width: 600px) {
  .lf-gl, .lf-gm, .lf-scene.ghost .lf-gl.hid, .lf-scene.ghost .lf-gm.hid { display: none; }
  .lf-hot::after { content: ""; position: absolute; left: 50%; top: 20%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%;
    background: var(--dot, #fff); box-shadow: 0 0 0 1.5px #000; }
  .lf-hot.hid::after { background: transparent; box-shadow: 0 0 0 1.5px var(--dot, #fff), 0 0 0 3px #000; }
  .lf-tip, .lf-tip.flipx, .lf-tip.flipy, .lf-tip.flipx.flipy { left: 0 !important; width: 100%; max-width: none; transform: none; }
}
@media (max-width: 560px) { .lf-showcase { grid-template-columns: minmax(0, 1fr); } .lf-ghost { margin-left: 0; } }
