/* LFM terminal chrome — boot strip + command bar.
   On Store / Resources / 404 (NOT the homepage, NOT the TG series).
   Self-hosted, CSP-safe (no external origins). Plain and legible — no glow. */

#lfm-boot,#lfm-cmd,#lfm-pal,#lfm-out{
  --tc-ink:#d8d6d0; --tc-mut:#8c8b86; --tc-green:#5bbf86;
  --tc-red:#c92a2a; --tc-ln:rgba(255,255,255,.13);
  --tc-fl:'JetBrains Mono',monospace;
  box-sizing:border-box;
}
#lfm-boot *,#lfm-cmd *,#lfm-pal *,#lfm-out *{box-sizing:border-box}

/* ── Top boot strip ─────────────────────────────────────────── */
#lfm-boot{
  position:fixed; top:0; left:0; right:0; z-index:120;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:11px clamp(16px,4vw,34px);
  font-family:var(--tc-fl); font-size:11px; letter-spacing:.14em; text-transform:uppercase;
  color:#fff; mix-blend-mode:difference; pointer-events:none;
}
#lfm-boot .tc-id{display:flex; align-items:center; gap:9px}
#lfm-boot .tc-mk{width:10px; height:10px; background:var(--tc-red); flex:0 0 auto}
#lfm-boot .tc-path{opacity:.9}
#lfm-boot .tc-soc{display:flex; align-items:center; gap:14px}
#lfm-boot .tc-soc a{display:flex; color:#fff; opacity:.82; transition:opacity .15s; pointer-events:auto}
#lfm-boot .tc-soc a:hover{opacity:1}
#lfm-boot .tc-soc svg{width:16px; height:16px; display:block}

/* ── Bottom command bar ─────────────────────────────────────── */
#lfm-cmd{
  position:fixed; left:0; right:0; bottom:0; z-index:130;
  display:flex; align-items:center; gap:12px;
  padding:11px clamp(16px,4vw,34px);
  padding-bottom:calc(11px + env(safe-area-inset-bottom));
  min-height:46px;
  background:rgba(8,9,8,.95); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border-top:1px solid var(--tc-ln);
  font-family:var(--tc-fl); font-size:13px; color:var(--tc-ink);
  transition:transform .35s ease, opacity .35s ease;
}
/* homepage: hidden until you scroll past the hero, then slides up into view */
#lfm-cmd.tc-veil{transform:translateY(112%); opacity:0; pointer-events:none}
#lfm-cmd .tc-prompt{color:var(--tc-green); font-weight:700; flex:0 0 auto; letter-spacing:.01em; white-space:nowrap}
#lfm-cmd input{
  flex:1 1 auto; min-width:0; background:transparent; border:0; outline:0;
  font-family:var(--tc-fl); font-size:13px; color:var(--tc-ink); letter-spacing:.02em;
  caret-color:var(--tc-green);
}
#lfm-cmd input::placeholder{color:var(--tc-mut); opacity:.85}
#lfm-cmd .tc-hint{flex:0 0 auto; color:var(--tc-mut); font-size:11px; letter-spacing:.12em; text-transform:uppercase; opacity:.8}
@media(max-width:560px){
  #lfm-cmd .tc-hint{display:none}
  #lfm-cmd input{font-size:16px}   /* avoid iOS focus-zoom */
  #lfm-cmd .tc-prompt{font-size:12px}
}

/* ── Shell scrollback (output from typed commands) ───────────── */
#lfm-out{
  position:fixed; left:0; right:0; bottom:46px; z-index:135;
  display:none; padding:0 clamp(16px,4vw,34px);
  font-family:var(--tc-fl); pointer-events:none;
}
#lfm-out.tc-show{display:block}
#lfm-out{max-height:min(56vh,460px); overflow:auto}
#lfm-out > *{
  max-width:560px; pointer-events:auto;
  background:rgba(8,9,8,.98); border:1px solid var(--tc-ln); border-bottom:0;
  padding:6px 16px; font-size:12.5px; line-height:1.5; color:var(--tc-ink);
}
#lfm-out > *:first-child{border-top:0}
#lfm-out .tc-echo{color:var(--tc-mut)}
#lfm-out .tc-echo .tc-pr{color:var(--tc-green)}
#lfm-out .tc-out{box-shadow:0 -10px 30px rgba(0,0,0,.4)}
#lfm-out pre{
  margin:0; font-family:var(--tc-fl); font-size:12.5px; line-height:1.5;
  color:var(--tc-ink); white-space:pre; overflow-x:auto;
}

/* ── Konami flash (transition only — survives Reduce Motion) ──── */
#lfm-flash{
  position:fixed; inset:0; z-index:200; pointer-events:none;
  background:radial-gradient(120% 90% at 50% 50%,rgba(91,191,134,.14),transparent 70%);
  opacity:0; transition:opacity .26s ease;
}
#lfm-flash.on{opacity:1}

/* ── Command palette ────────────────────────────────────────── */
#lfm-pal{
  position:fixed; left:0; right:0; bottom:46px; z-index:140;
  display:none; padding:0 clamp(16px,4vw,34px);
  font-family:var(--tc-fl);
}
#lfm-pal.tc-open{display:block}
#lfm-pal .tc-list{
  max-width:540px;
  background:rgba(8,9,8,.98); border:1px solid var(--tc-ln); border-bottom:0;
  box-shadow:0 -12px 40px rgba(0,0,0,.55);
  max-height:min(54vh,440px); overflow:auto;
}
#lfm-pal .tc-row{
  display:flex; align-items:baseline; gap:12px; padding:11px 16px; cursor:pointer;
  border-bottom:1px solid rgba(255,255,255,.05); color:var(--tc-ink);
}
#lfm-pal .tc-row:last-child{border-bottom:0}
#lfm-pal .tc-cmd{color:var(--tc-green); font-size:13px; letter-spacing:.02em; flex:0 0 auto; min-width:112px}
#lfm-pal .tc-desc{color:var(--tc-mut); font-size:12px}
#lfm-pal .tc-ext{margin-left:auto; color:var(--tc-mut); font-size:10px; letter-spacing:.12em; opacity:.7; flex:0 0 auto}
#lfm-pal .tc-row.tc-sel,#lfm-pal .tc-row:hover{background:rgba(255,255,255,.07)}
#lfm-pal .tc-row.tc-sel .tc-cmd{color:#84d6a8}
#lfm-pal .tc-empty{padding:13px 16px; color:var(--tc-mut); font-size:12px}

/* keep page content clear of the fixed command bar (added by JS) */
body.tc-on{padding-bottom:calc(50px + env(safe-area-inset-bottom))}
