/* ==========================================================================
   ZEZO SMP — Player Search & Profile  (mobile-first, animated)
   Uses the site theme tokens with safe fallbacks.
   ========================================================================== */

.lb-search-section {
    max-width: 720px;
    margin: 8px auto 28px;
    padding: 0 16px;
    animation: lbFadeUp .6s both;
}

.lb-search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 18px;
    border-radius: 999px;
    background: var(--glass-bg, rgba(30, 41, 59, .7));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, .12));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
    transition: border-color .25s, box-shadow .25s, transform .25s;
}
.lb-search-box:focus-within {
    border-color: var(--primary, #8b5cf6);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, #8b5cf6) 28%, transparent), 0 14px 40px rgba(0, 0, 0, .34);
    transform: translateY(-1px);
}
.lb-search-box > i.fas {
    color: var(--primary, #8b5cf6);
    font-size: 1.05rem;
    flex-shrink: 0;
}
#lb-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main, #f8fafc);
    font: 600 1rem 'Poppins', sans-serif;
    padding: 12px 4px;
}
#lb-search-input::placeholder { color: var(--text-muted, #94a3b8); font-weight: 500; }

#lb-search-clear {
    display: none;
    place-items: center;
    width: 34px; height: 34px;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: var(--text-muted, #cbd5e1);
    font-size: 1.3rem; line-height: 1; cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
}
#lb-search-clear:hover { background: var(--accent, #ec4899); color: #fff; transform: rotate(90deg); }

.lb-search-hint {
    text-align: center;
    margin-top: 10px;
    font-size: .82rem;
    color: var(--text-muted, #94a3b8);
}
.lb-search-hint b { color: var(--primary, #8b5cf6); }

/* ---- suggestions dropdown ---- */
.lb-search-suggest {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    z-index: 40;
    padding: 6px;
    border-radius: 18px;
    background: var(--glass-bg, rgba(20, 26, 42, .92));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, .12));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
    max-height: 360px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    pointer-events: none;
    transition: opacity .18s, transform .18s;
}
.lb-search-suggest.show { opacity: 1; transform: none; pointer-events: auto; }

.lb-suggest-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-main, #f1f5f9);
    cursor: pointer;
    text-align: left;
    transition: background .15s, transform .15s;
}
.lb-suggest-row:hover, .lb-suggest-row.active { background: color-mix(in srgb, var(--primary, #8b5cf6) 22%, transparent); transform: translateX(2px); }
.lb-suggest-head { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; background: rgba(255, 255, 255, .06); }
.lb-suggest-name { flex: 1; font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-suggest-tag {
    font-size: .64rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
    padding: 3px 8px; border-radius: 999px;
    background: rgba(56, 189, 248, .16); color: #38bdf8;
}
.lb-suggest-tag.java { background: rgba(52, 211, 153, .16); color: #34d399; }
.lb-suggest-empty { padding: 16px; text-align: center; color: var(--text-muted, #94a3b8); font-size: .9rem; }

/* ---- profile overlay ---- */
.lb-profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(4, 7, 18, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .26s ease;
}
.lb-profile-overlay.show { opacity: 1; }
.lb-profile-overlay[hidden] { display: none; }

.lb-profile-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 26px 20px 24px;
    border-radius: 26px 26px 0 0;
    background: var(--glass-bg, rgba(17, 23, 39, .96));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, .12));
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
    transform: translateY(40px);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.lb-profile-overlay.show .lb-profile-card { transform: none; }

.lb-profile-close {
    position: absolute; top: 12px; right: 14px;
    width: 40px; height: 40px;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: var(--text-muted, #cbd5e1);
    font-size: 1.7rem; line-height: 1; cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
}
.lb-profile-close:hover { background: var(--danger, #ef4444); color: #fff; transform: rotate(90deg); }

.lb-profile-hero {
    display: flex;
    gap: 18px;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, .1));
}
.lb-profile-skin { position: relative; width: 92px; flex-shrink: 0; display: grid; place-items: center; }
.lb-profile-skin img { width: 92px; height: auto; image-rendering: pixelated; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .5)); animation: lbFloat 4s ease-in-out infinite; }
.lb-profile-skin-fallback {
    display: none;
    width: 84px; height: 84px; border-radius: 18px;
    place-items: center;
    background: linear-gradient(135deg, var(--primary, #8b5cf6), var(--accent, #ec4899));
    color: #fff; font-weight: 800; font-size: 1.9rem;
}
.lb-profile-id { min-width: 0; }
.lb-profile-namerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lb-profile-namerow h3 { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--text-main, #fff); word-break: break-word; }
.lb-profile-platform { margin-top: 4px; font-size: .82rem; color: var(--text-muted, #94a3b8); }
.lb-profile-platform i { margin-right: 5px; color: var(--primary, #8b5cf6); }
.lb-profile-highlights { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lb-highlight {
    font-size: .72rem; font-weight: 700;
    padding: 4px 9px; border-radius: 999px;
    background: rgba(255, 255, 255, .07); color: var(--text-main, #e2e8f0);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, .1));
}
.lb-highlight i { margin-right: 4px; }
.lb-highlight.gold { background: rgba(250, 204, 21, .16); color: #facc15; border-color: rgba(250, 204, 21, .3); }
.lb-highlight.silver { background: rgba(203, 213, 225, .16); color: #cbd5e1; }
.lb-highlight.bronze { background: rgba(217, 119, 6, .16); color: #f59e0b; }

.lb-profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.lb-stat-card {
    padding: 14px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, .08));
    transition: transform .2s, border-color .2s, background .2s;
    animation: lbPop .4s both;
}
.lb-stat-card:hover { transform: translateY(-3px); border-color: var(--primary, #8b5cf6); background: rgba(255, 255, 255, .07); }
.lb-stat-card.dim { opacity: .5; }
.lb-stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lb-stat-top > i { font-size: 1.05rem; color: var(--primary, #8b5cf6); }
.lb-stat-pos {
    font-size: .7rem; font-weight: 800;
    padding: 2px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .1); color: var(--text-muted, #cbd5e1);
}
.lb-stat-pos.gold { background: rgba(250, 204, 21, .2); color: #facc15; }
.lb-stat-pos.silver { background: rgba(203, 213, 225, .2); color: #e2e8f0; }
.lb-stat-pos.bronze { background: rgba(217, 119, 6, .2); color: #f59e0b; }
.lb-stat-value { font-size: 1.25rem; font-weight: 800; color: var(--text-main, #fff); line-height: 1.1; word-break: break-word; }
.lb-stat-label { margin-top: 3px; font-size: .74rem; color: var(--text-muted, #94a3b8); text-transform: uppercase; letter-spacing: .4px; }

/* ---- animations ---- */
@keyframes lbFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes lbPop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes lbFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.lb-stat-card:nth-child(1) { animation-delay: .02s; } .lb-stat-card:nth-child(2) { animation-delay: .05s; }
.lb-stat-card:nth-child(3) { animation-delay: .08s; } .lb-stat-card:nth-child(4) { animation-delay: .11s; }
.lb-stat-card:nth-child(5) { animation-delay: .14s; } .lb-stat-card:nth-child(6) { animation-delay: .17s; }
.lb-stat-card:nth-child(7) { animation-delay: .20s; } .lb-stat-card:nth-child(8) { animation-delay: .23s; }
.lb-stat-card:nth-child(9) { animation-delay: .26s; } .lb-stat-card:nth-child(10) { animation-delay: .29s; }
.lb-stat-card:nth-child(11) { animation-delay: .32s; }

/* ---- tablet / desktop ---- */
@media (min-width: 620px) {
    .lb-profile-overlay { align-items: center; padding: 24px; }
    .lb-profile-card { border-radius: 26px; max-width: 680px; }
    .lb-profile-card { transform: translateY(24px) scale(.98); }
    .lb-profile-overlay.show .lb-profile-card { transform: none; }
    .lb-profile-stats { grid-template-columns: repeat(3, 1fr); }
    .lb-profile-skin, .lb-profile-skin img { width: 104px; }
}
@media (min-width: 900px) {
    .lb-profile-stats { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .lb-search-section, .lb-stat-card, .lb-profile-skin img { animation: none !important; }
    .lb-profile-card, .lb-profile-overlay, .lb-search-suggest, .lb-suggest-row, #lb-search-clear { transition: none !important; }
}
