/* assets/css/live-square.css — Live Square */

#liveSquare {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 80vh;
    overflow: hidden;
    background: #0b1119;
    color: #fff;
    font-family: inherit;
}

/* --- top HUD --- */
.ls-hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px;
    z-index: 5;
    background: linear-gradient(180deg, rgba(0,0,0,.7), transparent);
    font-size: 13px;
    pointer-events: none;
}
.ls-hud > * { pointer-events: auto; }
.ls-hud-left, .ls-hud-right { display: flex; gap: 10px; align-items: center; }
.ls-pill {
    background: rgba(10,15,22,.7);
    border: 1px solid rgba(255,255,255,.12);
    padding: 4px 10px; border-radius: 999px;
    backdrop-filter: blur(8px);
    font-weight: 600;
}
.ls-pill .ls-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: #22c55e; margin-right: 6px; vertical-align: middle;
    box-shadow: 0 0 8px #22c55e;
    animation: ls-pulse 1.6s ease-in-out infinite;
}
@keyframes ls-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* --- canvas --- */
#lsCanvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    cursor: grab;
}
#lsCanvas:active { cursor: grabbing; }

/* --- pucks layer --- */
#lsPucks {
    position: absolute; inset: 0;
    pointer-events: none;
}
.ls-puck {
    position: absolute;
    width: 44px; height: 44px;
    border-radius: 50%;
    background-size: cover; background-position: center;
    border: 2px solid rgba(255,255,255,.85);
    box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 6px 14px rgba(0,0,0,.4);
    transform: translate(-50%, -100%);
    transition: transform .1s ease-out;
    pointer-events: auto;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
    will-change: left, top;
    transition: left 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.1s;
}
.ls-puck.ls-me {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px #f59e0b, 0 0 18px rgba(245,158,11,.7);
}
.ls-puck.ls-guest { border-style: dashed; opacity: .9; }
.ls-puck:hover { transform: translate(-50%, -100%) scale(1.1); z-index: 10; }

/* --- bubbles --- */
.ls-bubble {
    position: absolute;
    transform: translate(-50%, -100%);
    background: rgba(255,255,255,.96);
    color: #111;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px; font-weight: 600;
    white-space: nowrap; max-width: 220px;
    overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    opacity: 0;
    animation: ls-bubble-fade 6s ease forwards;
    z-index: 20;
}
.ls-bubble::after {
    content: '';
    position: absolute; bottom: -5px; left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px; height: 8px;
    background: rgba(255,255,255,.96);
}
@keyframes ls-bubble-fade {
    0%   { opacity: 0; transform: translate(-50%, -90%); }
    10%  { opacity: 1; transform: translate(-50%, -100%); }
    85%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -120%); }
}

/* =========================================
   FLOATING TOGGLE BUTTONS
   ========================================= */
.ls-floating-btn {
    position: absolute;
    z-index: 15;
    background: rgba(10,15,22,.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    border-radius: 50%;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: all 0.2s;
}
.ls-floating-btn:hover {
    background: rgba(255,255,255,.15);
    transform: scale(1.05);
}
.ls-floating-btn i { font-size: 18px; }

.ls-feed-btn {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 3px solid #f59e0b;
}
.ls-feed-btn:hover { transform: translateY(-50%) scale(1.05); }

.ls-online-btn {
    right: 12px;
    bottom: 76px;
    border-right: 3px solid #22c55e;
}

.ls-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px; font-weight: 800;
    padding: 2px 6px; border-radius: 999px;
    border: 2px solid #0b1119;
    animation: ls-pulse 1.5s infinite;
}

/* =========================================
   PANELS
   ========================================= */
.ls-feed {
    position: absolute;
    top: 56px; left: 12px; bottom: 76px;
    width: 280px;
    background: rgba(10,15,22,.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    padding: 12px;
    overflow-y: auto;
    z-index: 15;
    font-size: 13px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}
.ls-online {
    position: absolute;
    top: 56px; right: 12px; bottom: 76px;
    width: 72px;
    background: rgba(10,15,22,.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    padding: 10px 6px;
    overflow-y: auto;
    z-index: 15;
    display: flex; flex-direction: column; gap: 8px;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.ls-feed h3 {
    margin: 0 0 10px;
    font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
    opacity: .6; font-weight: 700;
}
.ls-event {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
    animation: ls-event-in .35s ease;
}
.ls-event:last-child { border-bottom: none; }
@keyframes ls-event-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.ls-event-av {
    width: 26px; height: 26px; border-radius: 50%;
    background-size: cover; background-position: center;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
}
.ls-event-body { flex: 1; min-width: 0; }
.ls-event-name { font-weight: 700; color: #fff; }
.ls-event-text { color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.35; }
.ls-event-time { font-size: 10px; opacity: .55; margin-left: 4px; }
.ls-event.is-recycled { opacity: .65; }
.ls-event.is-recycled .ls-event-name::after {
    content: ' · earlier';
    font-size: 10px; opacity: .6; font-weight: 500;
}

.ls-online-head { font-size: 10px; opacity: .55; letter-spacing: .1em; text-transform: uppercase; }
.ls-online-av {
    width: 40px; height: 40px; border-radius: 50%;
    background-size: cover; background-position: center;
    border: 2px solid rgba(255,255,255,.15);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #fff;
    transition: transform .15s;
}
.ls-online-av:hover { transform: scale(1.08); border-color: #f59e0b; }

.ls-places {
    position: absolute;
    left: 12px; right: 46px;
    bottom: 40px;
    height: 54px;
    background: rgba(10,15,22,.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    z-index: 15;
    display: flex; align-items: center; gap: 4px;
    overflow-x: auto;
    padding: 6px 10px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.ls-place {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.85);
    font-size: 12px; font-weight: 600; white-space: nowrap;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.ls-place:hover { background: rgba(255,255,255,.12); }
.ls-place .ls-place-count {
    font-size: 10px; opacity: .7; background: rgba(0,0,0,.3);
    padding: 1px 6px; border-radius: 999px;
}

/* Highlight new important events */
@keyframes ls-flash {
    0% { background: rgba(245, 158, 11, 0.4); }
    100% { background: transparent; }
}
.ls-event.important-new {
    animation: ls-flash 2s ease-out;
    border-left: 3px solid #f59e0b;
    padding-left: 6px;
}

/* Utility */
.ls-hidden { display: none !important; }

/* =========================================
   MOBILE ADJUSTMENTS
   ========================================= */
@media (max-width: 768px) {
    .ls-feed-btn { left: 8px; width: 42px; height: 42px; }
    .ls-online-btn { right: 8px; bottom: 70px; width: 42px; height: 42px; }
    .ls-places { left: 8px; right: 66px; }

    /* Mobile Feed Panel (Slides up from bottom) */
    .ls-feed {
        top: auto; left: 0; right: 0; bottom: 0;
        width: 100%; height: 60vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
    }
    .ls-feed:not(.ls-hidden) {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Mobile Online Panel (Slides in from right) */
    .ls-online {
        top: 56px; right: 12px; bottom: auto;
        height: auto; max-height: 50vh;
        transform: translateX(120%);
        opacity: 0;
        pointer-events: none;
    }
    .ls-online:not(.ls-hidden) {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Mobile Peek State for Feed */
    .ls-feed.ls-mobile-peek:not(.ls-hidden) {
        height: 40vh;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    }
}
/* --- User Profile Popup --- */
.ls-user-popup {
    position: absolute;
    bottom: 80px; left: 50%;
    transform: translateX(-50%);
    width: 300px;
    background: rgba(10,15,22,.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 20px;
    padding: 16px;
    z-index: 30;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    transition: opacity 0.2s, transform 0.2s;
}
.ls-user-popup.ls-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
}
.ls-up-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ls-up-avatar {
    width: 50px; height: 50px; border-radius: 50%;
    background-size: cover; background-position: center;
    border: 2px solid rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 18px;
}
.ls-up-header h4 { margin: 0; font-size: 16px; font-weight: 800; color: #fff; }
.ls-up-header p { margin: 0; font-size: 12px; color: rgba(255,255,255,.6); }
.ls-up-actions { display: flex; gap: 8px; }
.ls-up-actions button {
    flex: 1; padding: 10px; border-radius: 12px; border: none;
    font-weight: bold; font-size: 13px; cursor: pointer;
    transition: opacity 0.2s;
}
.ls-up-actions button:hover { opacity: 0.8; }
.ls-btn-follow { background: #f59e0b; color: #000; }
.ls-btn-chat { background: rgba(255,255,255,.1); color: #fff; }

/* Ensure the canvas base is deep space */
#lsCanvas {
    background: #04031a;
}

#lsCanvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    cursor: grab;
    background: #04031a; /* Deep space base */
}
#lsCanvas:active { cursor: grabbing; }

/* ... further down, make sure the popup is visible above the map ... */
.ls-user-popup {
    position: absolute;
    bottom: 80px; left: 50%;
    transform: translateX(-50%);
    width: 320px;
    background: rgba(15, 23, 42, 0.95); /* Darker background for readability */
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 20px;
    padding: 16px;
    z-index: 30;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    transition: opacity 0.2s, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Make the HUD buttons look like glass */
.ls-hud-btn {
    background: rgba(10,15,22,.6);
    border: 1px solid rgba(255,255,255,.1);
    padding: 6px 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}
.ls-hud-btn:hover { background: rgba(255,255,255,.15); }
/* =========================================
   LIVE PLACE MODAL
   ========================================= */
.ls-place-modal {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 75vh;
    background: rgba(10, 15, 22, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px 24px 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.ls-place-modal.ls-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}
.ls-pm-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ls-pm-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.ls-pm-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; gap: 8px;
    background: rgba(10,15,22,0.8);
}

/* Desktop: Make it a floating window on the right */
@media (min-width: 768px) {
    .ls-place-modal {
        top: 40px; bottom: 20px; left: auto; right: 20px;
        width: 380px;
        border-radius: 20px;
        border: 1px solid rgba(255,255,255,0.15);
        height: auto;
        transform: translateX(120%);
    }
    .ls-place-modal.ls-hidden {
        transform: translateX(120%);
    }
    .ls-place-modal:not(.ls-hidden) {
        transform: translateX(0);
    }
}

/* ─── Engagement tier badges ─── */
.ls-tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    margin-left: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 12px currentColor;
}

.ls-tier-badge.pulse-new    { animation: ls-tier-new 2s ease-in-out infinite; color: #22d3ee; background: rgba(34,211,238,.15); }
.ls-tier-badge.flicker      { animation: ls-tier-flicker 1.2s ease-in-out infinite; color: #f97316; background: rgba(249,115,22,.2); }
.ls-tier-badge.rise         { animation: ls-tier-rise 2.4s ease-in-out infinite; color: #a855f7; background: rgba(168,85,247,.2); }
.ls-tier-badge.pulse-soft   { animation: ls-tier-soft 3s ease-in-out infinite; color: #22c55e; background: rgba(34,197,94,.15); }

@keyframes ls-tier-new {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(34,211,238,.5); }
    50%      { transform: scale(1.18); box-shadow: 0 0 20px rgba(34,211,238,.9); }
}
@keyframes ls-tier-flicker {
    0%, 100% { transform: scale(1); opacity: 1; }
    40%      { transform: scale(1.1); opacity: .85; }
    60%      { transform: scale(.95); opacity: 1; }
}
@keyframes ls-tier-rise {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-3px) scale(1.08); }
}
@keyframes ls-tier-soft {
    0%, 100% { opacity: .7; }
    50%      { opacity: 1; }
}

/* ─── Nested topic thread view inside the place modal ─── */
.ls-pm-thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.25);
}
.ls-pm-thread-back {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}
.ls-pm-thread-back:hover { background: rgba(255,255,255,0.18); }

.ls-pm-thread-title {
    flex: 1;
    min-width: 0;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ls-pm-thread-see {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 999px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background .15s;
}
.ls-pm-thread-see:hover { background: rgba(245, 158, 11, 0.25); }

/* Reply input bar for topic thread */
.ls-pm-reply-bar {
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.ls-pm-reply-bar input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 999px;
    outline: none;
}
.ls-pm-reply-bar input:focus {
    border-color: rgba(245,158,11,0.6);
}
.ls-pm-reply-bar button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f59e0b;
    color: #000;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s;
}
.ls-pm-reply-bar button:hover { transform: scale(1.05); }
.ls-pm-reply-bar button:disabled { opacity: .5; cursor: default; }

/* Reply row */
.ls-reply {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    animation: ls-event-in .3s ease;
}
.ls-reply:last-child { border-bottom: none; }
.ls-reply-av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
}
.ls-reply-body { flex: 1; min-width: 0; }
.ls-reply-name {
    font-weight: 700;
    color: #fff;
    font-size: 13px;
    margin-bottom: 2px;
}
.ls-reply-time {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    margin-left: 6px;
    font-weight: 400;
}
.ls-reply-text {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ─── DESKTOP: taller place modal + visible activity by default ─── */
@media (min-width: 768px) {
    .ls-place-modal {
        top: 30px !important;
        bottom: 10px !important;
        right: 20px !important;
        width: 400px !important;
        height: auto !important;
        max-height: none;
    }
    /* Desktop default: feed panel shown (unless user hid it) */
    .ls-feed {
        /* JS controls this via .ls-hidden; default is visible */
    }
    /* Increase reply view height on desktop */
    .ls-pm-body { padding: 16px 18px; }
}

/* ─── Aza Plaza orbiting mini-avatars ─── */
#lsPlazaOrbit {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 8;
}

.ls-orbit-ring {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
}

.ls-orbit-av {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1.5px solid rgba(245, 158, 11, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(245, 158, 11, 0.4);
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    animation: ls-orbit-pulse 3s ease-in-out infinite;
    transition: transform 0.2s, box-shadow 0.2s;
}
.ls-orbit-av:hover {
    transform: scale(1.4) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6), 0 0 24px rgba(245, 158, 11, 0.9);
    z-index: 20;
}
.ls-orbit-guest { border-style: dashed; opacity: 0.9; }
.ls-orbit-more {
    background: #f59e0b !important;
    color: #000;
    border-color: #f59e0b;
    font-weight: 900;
    font-size: 10px;
}

@keyframes ls-orbit-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 12px rgba(245,158,11,0.4); }
    50%      { box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 20px rgba(245,158,11,0.8); }
}

/* ─── Marketplace product cards ─── */
/*
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Welcome overlay animation 
#lsWelcomeOverlay:not(.hidden) #lsWelcomeCard {
    animation: welcomeSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes welcomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes guestPromptSlide {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
*/