/* ========================================
   User Widget - Shared Across All Games
   ======================================== */

/* Avatar Container */
.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Avatar Circle */
.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.user-avatar.free-mode {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.user-avatar:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Status Badge (kleiner Punkt am Avatar) — Nachrichtenchecker */
.user-avatar .status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e74c3c;
    border: 2px solid white;
    z-index: 3;
    display: none;
}

.user-avatar .status-dot.has-messages {
    display: block;
    background: #e74c3c;
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Hover Tooltip */
.user-avatar-tooltip {
    position: absolute;
    bottom: -35px;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.user-avatar:hover .user-avatar-tooltip {
    opacity: 1;
}

/* Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.user-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Dropdown Header */
.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.user-dropdown-header .user-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.user-dropdown-header .user-status {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-dropdown-header .status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.user-dropdown-header .status-badge.registered {
    background: #d1fae5;
    color: #065f46;
}

.user-dropdown-header .status-badge.free {
    background: #fef3c7;
    color: #92400e;
}

/* Dropdown Items */
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background: #f8f9fa;
    padding-left: 20px;
}

.user-dropdown-item.admin {
    color: #7c3aed;
    font-weight: 600;
}

.user-dropdown-item.admin:hover {
    background: #f5f3ff;
}

.user-dropdown-item.logout {
    color: #dc2626;
}

.user-dropdown-item.logout:hover {
    background: #fef2f2;
}

.user-dropdown-item.active {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}

/* Game Icon in Dropdown */
.user-dropdown-item .game-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
}

/* Dropdown Section Divider */
.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .user-info {
        top: 15px;
        right: 15px;
    }

    .user-avatar {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }

    .user-dropdown {
        min-width: 200px;
    }

    .user-dropdown-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .user-dropdown-item .game-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .user-info {
        top: 10px;
        right: 10px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .user-avatar .status-dot {
        width: 10px;
        height: 10px;
    }

    .user-dropdown {
        min-width: 180px;
        right: -10px;
    }

    .user-dropdown-header {
        padding: 12px;
    }

    .user-dropdown-header .user-name {
        font-size: 14px;
    }

    .user-dropdown-item {
        padding: 10px 12px;
        font-size: 12px;
        gap: 10px;
    }

    .user-dropdown-item .game-icon {
        width: 18px;
        height: 18px;
    }
}
