/* Лут-фильтр */
.lf { max-width: 1100px; }
.lfbar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 6px; padding: 10px 12px; background: #19161c; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.lflvl { display: inline-flex; flex-wrap: wrap; padding: 2px; background: #141216; border: 1px solid #2c2830; border-radius: 9px; }
.lflvl button { padding: 6px 13px; background: none; border: 0; border-radius: 7px; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.lflvl button.on { background: #2a2214; color: #f0cd75; }
.lfreset { margin-left: auto; padding: 8px 14px; background: none; border: 1px solid #3a3540; border-radius: 8px; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.lfreset:hover { color: var(--text); border-color: #4a4350; }
.lfreset.sure { background: #2b1614; border-color: #7a3a32; color: #f0a597; }
.lfget { padding: 8px 16px; background: #2a2214; border: 1px solid var(--gold-dim); border-radius: 8px; color: #f0cd75; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.lfget:hover { background: #352a17; }
.lfhow { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.lfhow code { color: var(--text); font-size: 12.5px; }
.lfnote { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; }
.lfsoon { margin: 40px 0; color: var(--muted); text-align: center; font-size: 16px; }

.lfbox { margin: 0 0 14px; padding: 8px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.lfbox h2 { margin: 4px 0 6px; color: #e3d4ae; font-size: 16px; font-weight: 600; }
.lfrow { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto 72px; align-items: center; gap: 6px 12px; padding: 7px 0; border-top: 1px solid #2a2630; }
.lfname { color: #cfc8bc; font-size: 14px; }
.lft { display: inline-block; min-width: 26px; padding: 1px 6px; border-radius: 5px; background: #2a2630; color: #e9e4da; font-size: 13px; text-align: center; }
.lft-s { background: #fff; color: #d00; }
.lft-a { background: #f5695a; color: #fff; }
.lft-b { background: #f58b57; color: #000; }
.lft-c { background: #f0b464; color: #000; }
.lft-d { background: #000; color: #f0cf84; box-shadow: inset 0 0 0 1px #5c4d2c; }
.lft-e { background: #000; color: #dcaf84; }
.lfrow.off .lfname, .lfrow.off .lfl { opacity: .35; }
.lfrow.off .lfp { opacity: .35; pointer-events: none; }

/* подпись как в игре (клик — свой вид) */
.lfl { display: inline-flex; align-items: center; gap: 8px; justify-self: start; max-width: 100%; padding: 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.lfl > span { min-width: 0; padding: 2px 9px; border: 1.5px solid transparent; font-family: 'Fontin SmallCaps', 'Palatino Linotype', Georgia, serif; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfl:hover > span { outline: 1px dashed rgba(240, 205, 117, .6); outline-offset: 2px; }
.lfl i { flex: none; font-style: normal; font-size: 13px; }
/* луч — столбик света над вещью */
.lfbeam { width: 4px; height: 20px; border-radius: 2px 2px 0 0; background: linear-gradient(to top, var(--c), transparent); box-shadow: 0 0 7px -1px var(--c); }
.lfbeam.temp { height: 13px; opacity: .6; }
.lfico::before { content: '●'; }
.lfico[data-shape="Diamond"]::before { content: '◆'; }
.lfico[data-shape="Star"]::before { content: '★'; }
.lfico[data-shape="Square"]::before { content: '■'; }
.lfico[data-shape="Triangle"]::before { content: '▲'; }
.lfico[data-shape="Hexagon"]::before { content: '⬢'; }
.lfico[data-shape="Cross"]::before { content: '✚'; }
.lfico[data-shape="Moon"]::before { content: '☾'; }
.lfico[data-shape="Raindrop"]::before { content: '💧'; }
.lfico[data-shape="Kite"]::before { content: '⬥'; }
.lfico[data-shape="Pentagon"]::before { content: '⬟'; }
.lfico[data-shape="UpsideDownHouse"]::before { content: '⯆'; }
.lfsnd { color: #cfc8bc; font-size: 11px; font-family: system-ui, sans-serif; }

.lfmodes { display: inline-flex; align-items: center; padding: 2px; background: #141216; border: 1px solid #2c2830; border-radius: 8px; }
.lfm { padding: 4px 9px; background: none; border: 0; border-radius: 6px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.lfm.on { background: #2a2214; color: #f0cd75; }
.lfm[data-mode="h"].on { background: #2b1614; color: #f0a597; }
.lf .lfn { flex: none; width: 46px; min-width: 0; height: auto; margin: 0; padding: 3px 5px; background: #0f0d11; border: 1px solid #2c2830; border-radius: 6px; color: var(--text); font: inherit; font-size: 13px; }
.lfn:focus { outline: none; border-color: var(--gold-dim); }
.lfrow:not(.until) .lfn[data-k="n"] { display: none; }
.lfp { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }

/* редактор вида */
.lfedw { grid-column: 1 / -1; }
.lfedw:empty { display: none; }
.lfed { display: grid; gap: 8px; padding: 10px 12px; background: #141216; border: 1px solid #2c2830; border-radius: 8px; }
.lfe-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: #cfc8bc; font-size: 13px; }
.lf .lfe-c, .lf .lfe-r { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.lf .lfp { flex-direction: row; }
.lf .lfed input[type="checkbox"] { margin: 0; }
.lf .lfed input[type="color"] { width: 30px; height: 22px; padding: 0; border: 1px solid #3a3540; border-radius: 4px; background: none; }
.lf .lfed input[type="color"]:disabled { opacity: .3; }
.lf .lfed input[type="range"] { width: 120px; }
.lf .lfed select { padding: 3px 6px; background: #0f0d11; border: 1px solid #2c2830; border-radius: 6px; color: var(--text); font: inherit; font-size: 13px; }
.lfplay { width: 26px; height: 24px; margin-left: -10px; padding: 0; background: #2a2214; border: 1px solid var(--gold-dim); border-radius: 6px; color: #f0cd75; font-size: 11px; line-height: 1; cursor: pointer; }
.lfplay:hover:not(:disabled) { background: #352a17; }
.lfplay:disabled { opacity: .3; cursor: default; }
.lfe-reset { margin-left: auto; padding: 1px 10px 3px; background: none; border: 1px solid #3a3540; border-radius: 6px; color: var(--muted); font: inherit; font-size: 16px; line-height: 1.2; cursor: pointer; }
.lfe-reset:hover { color: var(--text); border-color: #4a4350; }

/* ярус: вся строка раскрывает вещи; клик по вещи — меню переноса */
.lftier { cursor: pointer; }
.lftier:hover .lfname { color: #f0cd75; }
.lftier .lfname { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.lfcnt { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.lfarr::before { content: '▾'; color: var(--muted); font-style: normal; font-size: 12px; }
.lftier.open .lfarr::before { content: '▴'; }
.lfitems { grid-column: 1 / -1; cursor: default; }
.lfchips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 2px; }
.lfchip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 4px; background: #141216; border: 1px solid #2c2830; border-radius: 6px; color: #cfc8bc; font: inherit; font-size: 12.5px; cursor: pointer; }
.lfchip img { width: 20px; height: 20px; object-fit: contain; }
.lfchip.always::after { content: '👁'; font-size: 11px; opacity: .8; }
.lfchip:hover { border-color: #4a4350; }
/* уники: весь список, клик — подсветить (вверх) → скрыть (бледно) → как все */
.lfuitems { grid-column: 1 / -1; cursor: default; }
.lfsub { grid-template-columns: 130px auto 1fr; border-top: 0; padding: 2px 0 6px; }
.lfuhint { color: var(--muted); font-size: 12px; }
.lf .lfq { width: 240px; margin: 2px 0 6px; padding: 4px 8px; background: #0f0d11; border: 1px solid #2c2830; border-radius: 6px; color: var(--text); font: inherit; font-size: 13px; }
.lfq:focus { outline: none; border-color: var(--gold-dim); }
.lfuchips { max-height: 360px; overflow: auto; }
.lfu { color: #d08a4a; }
.lfu .lft { min-width: 18px; padding: 0 4px; font-size: 11px; }
.lfu.off { opacity: .35; text-decoration: line-through; }
.lfu.off.leak { opacity: .6; text-decoration-style: dashed; }
/* ярус от соседа по базе (фильтр знает уник только по базе) — пустой значок */
.lfu .lft.lfinh { background: none; color: inherit; box-shadow: inset 0 0 0 1px currentColor; opacity: .8; }
.lfu .lft.lfinh.lft-s { color: #ff6b6b; }
.lfu .lft.lfinh.lft-a { color: #f5695a; }
.lfu .lft.lfinh.lft-b { color: #f58b57; }
.lfu .lft.lfinh.lft-c { color: #f0b464; }
.lfu .lft.lfinh.lft-d { color: #f0cf84; }
.lfu .lft.lfinh.lft-e { color: #dcaf84; }
/* текущий выбор — белая обводка с отступом (ни у одного яруса такой нет) */
.lfmenu button.cur { outline: 2px solid #fff; outline-offset: 2px; }
.lfmenu:not(.u) .lfmu { display: none; }
.lfmenu button.lft-s { background: #fff; color: #d00; }
.lfmenu button.lft-a { background: #f5695a; color: #fff; }
.lfmenu button.lft-b { background: #f58b57; color: #000; }
.lfmenu button.lft-c { background: #f0b464; color: #000; }
.lfmenu button.lft-d { background: #000; color: #f0cf84; border-color: #5c4d2c; }
.lfmenu button.lft-e { background: #000; color: #dcaf84; }
.lf .lfp .lfn[data-k="p"] { width: 64px; }

.lfmenu { position: absolute; z-index: 50; display: flex; gap: 7px; padding: 6px; background: #19161c; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
.lfmenu button { min-width: 30px; padding: 4px 8px; background: #141216; border: 1px solid #2c2830; border-radius: 6px; color: #e9e4da; font: inherit; font-size: 13px; cursor: pointer; }
.lfmenu button.x { color: #f0a597; }
.lfhidden { padding: 8px 0 4px; border-top: 1px solid #2a2630; color: var(--muted); font-size: 13px; }
.lfhidden button { margin-left: 6px; padding: 2px 9px; background: none; border: 1px solid #3a3540; border-radius: 6px; color: #f0cd75; font: inherit; font-size: 12.5px; cursor: pointer; }
.lflvl button:focus-visible, .lfm:focus-visible, .lfl:focus-visible, .lfget:focus-visible, .lfchip:focus-visible { outline: 1px solid var(--gold); outline-offset: 1px; }

@media (max-width: 899px) {
  .lfbar { top: 0; }
  .lfget { margin-left: 0; width: 100%; }
  .lfrow { grid-template-columns: minmax(0, 1fr) auto; }
  .lfl { grid-column: 1 / -1; grid-row: 2; }
  .lfmodes { grid-column: 1 / -1; justify-self: start; }
}
