/* The command palette and the phone bottom bar (LOBBY_PLAN.md v2 4.8, step 7; static/js/command_palette.js,
 * static/js/phone_bar.js). Loaded by base.html on every page. Obsidian & gold like the top bar; no backdrop-filter
 * (both sit over the animated gold-dust canvas, and a blur there repaints every frame). */

/* ---------- Command palette ---------- */
#lr-cmd { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
#lr-cmd[hidden] { display: none; }
#lr-cmd .cmd-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .68); }
#lr-cmd .cmd-box {
    position: relative; width: min(600px, 100%); max-height: min(560px, 76vh); display: flex; flex-direction: column;
    border-radius: 16px; overflow: hidden; color: #e4e4e7; font-size: 13px;
    background: linear-gradient(to bottom, #15151b, #0b0c10);
    border: 1px solid rgba(245, 158, 11, .35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
    animation: cmd-in .16s ease-out;
}
@keyframes cmd-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
#lr-cmd .cmd-field { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 54px; border-bottom: 1px solid rgba(245, 158, 11, .18); }
#lr-cmd .cmd-field svg { width: 18px; height: 18px; flex: none; color: #d4a24c; }
#lr-cmd .cmd-field input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; color: #fafafa; font-size: 15px; }
#lr-cmd .cmd-field input::placeholder { color: #71717a; }
#lr-cmd .cmd-field input::-webkit-search-cancel-button { display: none; }
#lr-cmd kbd { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 5px; font: 600 10px/1.5 'JetBrains Mono', ui-monospace, monospace;
    color: #a1a1aa; background: #18181b; border: 1px solid #3f3f46; text-align: center; }
#lr-cmd .cmd-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
#lr-cmd .cmd-group { padding: 10px 10px 4px; font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgba(245, 158, 11, .75); }
#lr-cmd .cmd-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: 10px; color: inherit; text-decoration: none; cursor: pointer; }
#lr-cmd .cmd-row.on { background: rgba(245, 158, 11, .12); box-shadow: inset 2px 0 0 #fbbf24; }
#lr-cmd .cmd-ico { width: 28px; height: 28px; flex: none; display: flex; align-items: center; justify-content: center; color: #e5b85c; }
#lr-cmd .cmd-ico svg { width: 26px; height: 26px; }
#lr-cmd .cmd-ico.none::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(229, 184, 92, .55); }
#lr-cmd .cmd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#lr-cmd .cmd-main { font-weight: 600; color: #f4f4f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lr-cmd .cmd-sub { font-size: 11.5px; color: #a1a1aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lr-cmd .cmd-tag { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #71717a; }
#lr-cmd .cmd-row.on .cmd-tag { color: #fcd34d; }
#lr-cmd .cmd-empty { padding: 22px 14px; text-align: center; color: #a1a1aa; }
#lr-cmd .cmd-empty b { color: #fde68a; }
#lr-cmd .cmd-foot { flex: none; display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid rgba(245, 158, 11, .12); font-size: 11px; color: #71717a; }
#lr-cmd .cmd-foot kbd { margin-right: 3px; }
@media (max-width: 640px) {
    #lr-cmd { padding: 72px 8px 8px; }
    #lr-cmd .cmd-box { max-height: calc(100vh - 88px); max-height: calc(100dvh - 88px); }
    #lr-cmd .cmd-foot, #lr-cmd .cmd-esc { display: none; }
}
html.calm-motion #lr-cmd .cmd-box { animation: none; }

/* ---------- Phone bottom bar (under 768 px, non-game pages: html.lr-bar, set before paint by base.html) ---------- */
:root { --lr-bar: 0px; }
#lr-phonebar { display: none; }
@media (max-width: 767px) {
    html.lr-bar { --lr-bar: calc(58px + env(safe-area-inset-bottom, 0px)); }
    html.lr-bar #lr-phonebar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; height: var(--lr-bar); padding-bottom: env(safe-area-inset-bottom, 0px);
        display: grid; grid-template-columns: repeat(5, 1fr);
        background: linear-gradient(to bottom, rgba(14, 15, 20, .97), rgba(9, 10, 13, .99));
        border-top: 1px solid rgba(245, 158, 11, .22); box-shadow: 0 -12px 30px rgba(0, 0, 0, .5);
    }
    html.lr-bar #app-wrap { padding-bottom: var(--lr-bar); }
    /* The floating Social Tray stops above the bar, so its own button can close it. */
    html.lr-bar #social-tray { bottom: var(--lr-bar); }
    /* Page toasts and the Store's fitting-room pill sit above the bar. */
    html.lr-bar #lb-toast, html.lr-bar #em-toast, html.lr-bar #em-fit, html.lr-bar #rw-toast, html.lr-bar #settings-toast { margin-bottom: var(--lr-bar); }
}
#lr-phonebar .pb-item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-width: 0; padding: 0; border: 0; background: none; color: #a1a1aa; text-decoration: none; cursor: pointer;
    font: 600 10.5px/1 Inter, system-ui, sans-serif; letter-spacing: .02em; -webkit-tap-highlight-color: transparent;
}
#lr-phonebar .pb-item svg { width: 22px; height: 22px; }
#lr-phonebar .pb-item.on { color: #fbbf24; }
#lr-phonebar .pb-item.on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; border-radius: 0 0 2px 2px; background: #fbbf24; }
#lr-phonebar .pb-item:focus-visible { outline: 2px solid #fbbf24; outline-offset: -4px; border-radius: 10px; }
#lr-phonebar .pb-badge {
    position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    background: #f43f5e; color: #fff; font-size: 9.5px; line-height: 16px; text-align: center; border: 2px solid #0c0d12; box-sizing: content-box;
}
#lr-phonebar .pb-badge[hidden] { display: none; }
