/* ===== 3D SOCIAL LOBBY ===== */
#screen-social-lobby {
    background: #0a0e1a;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Starfield bg */
.lobby-starfield {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, #1a1e3a 0%, #0a0e1a 70%);
    overflow: hidden;
    z-index: 0;
}
.lobby-starfield .star {
    position: absolute;
    width: 2px; height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: starTwinkle 3s ease-in-out infinite alternate;
}
@keyframes starTwinkle {
    0% { opacity: 0.2; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.5); }
}

/* Top Bar */
.lobby-top-bar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lobby-top-bar .lobby-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 15px;
    color: #fff;
}
.lobby-top-bar .lobby-title i {
    color: #ffd700;
    font-size: 18px;
}
.lobby-online-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #00ffaa;
    font-weight: 700;
    background: rgba(0,255,170,0.08);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(0,255,170,0.15);
}
.lobby-online-badge .pulse-dot {
    width: 7px; height: 7px;
    background: #00ffaa;
    border-radius: 50%;
    animation: pulseDot 1.5s ease-in-out infinite;
}
@keyframes pulseDot {
    0%,100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.5; }
}

/* Isometric World Canvas */
.lobby-world-container {
    position: relative;
    z-index: 5;
    flex: 1;
    overflow: hidden;
    cursor: pointer;
}
.lobby-world-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: auto;
}

/* Bottom Action Bar */
.lobby-bottom-bar {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.06);
    align-items: center;
}
.lobby-chat-input-wrap {
    flex: 1;
    position: relative;
}
.lobby-chat-input-wrap input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.3s;
}
.lobby-chat-input-wrap input:focus {
    border-color: rgba(0,240,255,0.4);
}
.lobby-chat-input-wrap input::placeholder {
    color: rgba(255,255,255,0.3);
}
.lobby-action-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    flex-shrink: 0;
}
.lobby-action-btn:hover {
    background: rgba(0,240,255,0.15);
    border-color: rgba(0,240,255,0.3);
    color: #00f0ff;
}
.lobby-action-btn.primary-btn {
    background: linear-gradient(135deg, #00f0ff, #0088ff);
    color: #000;
    border: none;
    font-weight: 700;
}
.lobby-action-btn.danger-btn {
    background: rgba(255,62,62,0.12);
    border-color: rgba(255,62,62,0.25);
    color: #ff6b6b;
}

/* Floating Chat Bubbles */
.lobby-chat-overlay {
    position: absolute;
    bottom: 70px;
    left: 12px;
    right: 12px;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    max-height: 140px;
    overflow: hidden;
}
.lobby-chat-msg {
    padding: 6px 12px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    font-size: 12px;
    color: #e2e8f0;
    animation: chatSlideIn 0.3s ease-out;
    max-width: 80%;
}
.lobby-chat-msg .chat-nick {
    color: #00f0ff;
    font-weight: 700;
    margin-left: 6px;
}
.lobby-chat-msg.system-msg {
    color: #ffd700;
    font-style: italic;
    font-size: 11px;
}
@keyframes chatSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Player Interaction Panel (slides up) */
.lobby-player-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 20;
    background: rgba(10,14,26,0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    max-height: 55vh;
    overflow-y: auto;
}
.lobby-player-panel.active {
    transform: translateY(0);
}
.lobby-player-panel .panel-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: 0 auto 16px auto;
}
.panel-player-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.panel-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: #000;
    position: relative;
    flex-shrink: 0;
}
.panel-avatar .online-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 12px; height: 12px;
    background: #00ffaa;
    border: 2px solid #0a0e1a;
    border-radius: 50%;
}
.panel-player-details h3 {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}
.panel-player-details .panel-level {
    font-size: 11px;
    color: #00f0ff;
    font-weight: 700;
}
.panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.panel-action-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}
.panel-action-btn:hover {
    background: rgba(0,240,255,0.1);
    border-color: rgba(0,240,255,0.3);
}
.panel-action-btn.invite-btn {
    background: linear-gradient(135deg, #00f0ff22, #0088ff22);
    border-color: rgba(0,240,255,0.25);
    color: #00f0ff;
}
.panel-action-btn.friend-btn {
    background: rgba(0,255,170,0.08);
    border-color: rgba(0,255,170,0.2);
    color: #00ffaa;
}

/* Friends Panel Overlay */
.lobby-friends-overlay {
    position: absolute;
    top: 0; right: -280px;
    width: 270px;
    height: 100%;
    z-index: 15;
    background: rgba(10,14,26,0.95);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255,255,255,0.08);
    padding: 16px;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
}
.lobby-friends-overlay.active {
    right: 0;
}
.friends-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.friends-panel-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.friends-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.2s;
}
.friend-item:hover {
    background: rgba(0,240,255,0.06);
    border-color: rgba(0,240,255,0.15);
}
.friend-avatar-sm {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    position: relative;
    flex-shrink: 0;
}
.friend-avatar-sm .status-dot {
    position: absolute;
    bottom: 0; right: 0;
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 2px solid #0a0e1a;
}
.status-dot.online { background: #00ffaa; }
.status-dot.offline { background: #475569; }
.friend-info {
    flex: 1;
    min-width: 0;
}
.friend-info .fname {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.friend-info .flevel {
    font-size: 10px;
    color: #94a3b8;
}

/* Joystick (mobile touch) */
.lobby-joystick {
    position: absolute;
    bottom: 80px;
    left: 20px;
    z-index: 9;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.joystick-knob {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,240,255,0.25);
    border: 2px solid rgba(0,240,255,0.4);
    transition: transform 0.05s;
    pointer-events: none;
}

/* Interaction zones glow labels */
.zone-label {
    position: absolute;
    z-index: 6;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    pointer-events: none;
    animation: zonePulse 2s ease-in-out infinite;
    white-space: nowrap;
}
.zone-label.game-zone {
    background: rgba(255,215,0,0.15);
    border: 1px solid rgba(255,215,0,0.3);
    color: #ffd700;
}
.zone-label.shop-zone {
    background: rgba(0,240,255,0.1);
    border: 1px solid rgba(0,240,255,0.25);
    color: #00f0ff;
}
.zone-label.social-zone {
    background: rgba(0,255,170,0.1);
    border: 1px solid rgba(0,255,170,0.25);
    color: #00ffaa;
}
@keyframes zonePulse {
    0%,100% { opacity: 0.8; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

/* Quick emotes bar */
.lobby-emotes-bar {
    position: absolute;
    bottom: 70px;
    right: 12px;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.emote-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.emote-btn:hover {
    transform: scale(1.2);
    background: rgba(0,0,0,0.7);
}

/* Friend request notification badge */
.notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 16px; height: 16px;
    background: #ff3e3e;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0a0e1a;
}
